Our pure JavaScript Scheduler component


Post by jzd »

Hi there,

I'm trying to get the React demo to work using node 10.14.1 on a Mac, but it's not building properly. I'm using the latest trial, 1.1.2.

After I changed start.sh, copy.sh, and build.sh to be executable, I ran npm install and npm start as per the README and got this:
> ./start.sh

ℹ 「wds」: Project is running at https://localhost:3000/
ℹ 「wds」: webpack output is served from https://localhost:3000/dist
ℹ 「wds」: Content not from webpack is served from /scheduler-1.1.2-trial/examples/react_build/public
✖ 「wdm」: Hash: 6c32abd7307e3a3d82b2
Version: webpack 4.8.3
Time: 853ms
Built at: 12/11/2018 6:51:40 AM
    Asset     Size  Chunks             Chunk Names
bundle.js  366 KiB    main  [emitted]  main
Entrypoint main = bundle.js
[./node_modules/ansi-html/index.js] 4.16 KiB {main} [built]
[./node_modules/ansi-regex/index.js] 135 bytes {main} [built]
[./node_modules/loglevel/lib/loglevel.js] 7.68 KiB {main} [built]
[./node_modules/node-libs-browser/node_modules/punycode/punycode.js] 14.3 KiB {main} [built]
[./node_modules/url/url.js] 22.8 KiB {main} [built]
[0] multi (webpack)-dev-server/client?https://localhost:3000 ./src/index.jsx 40 bytes {main} [built]
[./node_modules/sockjs-client/dist/sockjs.js] 180 KiB {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/url/util.js] 314 bytes {main} [built]
[./node_modules/webpack-dev-server/client/index.js?https://localhost:3000] (webpack)-dev-server/client?https://localhost:3000 7.78 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.58 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.05 KiB {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
[./node_modules/webpack/hot/emitter.js] (webpack)/hot/emitter.js 77 bytes {main} [built]
[./src/index.jsx] 641 bytes {main} [built] [failed] [1 error]
    + 11 hidden modules

ERROR in ./src/index.jsx
Module build failed: SyntaxError: Unexpected token (6:4)

  4 | 
  5 | ReactDOM.render(
> 6 |     <App/>,
    |     ^
  7 |     document.getElementById('root')
  8 | );
  9 | 

 @ multi (webpack)-dev-server/client?https://localhost:3000 ./src/index.jsx
ℹ 「wdm」: Failed to compile.
Any ideas?
Last edited by jzd on Tue Dec 11, 2018 5:10 pm, edited 1 time in total.

Post by Maxim Gorkovsky »

Hello.
We have a ticket for this issue, we are investigating: https://app.assembla.com/spaces/bryntum ... en/details#

Post by Maxim Gorkovsky »

This should work already in latest nightlies. To fix this locally add this to your .babelrc file (or create one next to the package.json):
{
  "presets": ["env", "react", "stage-2"]
}

Post by jzd »

I just created the .babelrc file as instructed, under src and next to package.json. I re-ran npm install and npm start and got the same error.

Post by jzd »

Ah I take that back, it seems to build perfectly fine and works on localhost now. Thanks for the quick turnaround, Maxim!

Post by Maxim Gorkovsky »

Sure, yw. Sorry for inconvenience

Post by avonplato »

Hi,

I seem to be having a similair issue however the fix suggested does not work. I also downloaded the latest trial version 1.1.2 and have tried to follow the steps in the help doc.

First Problem
- The package.json file in the basic react example refers to a _shared/build folder which does not exist.
- I removed the /build and was able to run npm install successfully.

Second Problem
- If i try run npm start i get the following error

examples\react\javascript\basic\node_modules\.bin\react-scripts:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! basic@1.1.2 start: `node --max_old_space_size=8192 node_modules/.bin/react-scripts start`
npm ERR! Exit status 1

This is on a clean installation of windows 10 running node 10.16.0 and npm 6.9.0

Running the basic react demo from the help documentation also doesnt work as the "build" folder it points to does not exist. I tried building the example but cant get passed the above.

Any idea? At this point we are unable to even test / debug / create a basic react app.

Thanks

Post by Maxim Gorkovsky »

Hello.
Readme.md describes build procedure. First you need to navigate to examples/react/_shared and run npm install && npm run build. Then you navigate to examples/react/javascript/basic and run same npm i && npm run build.

I found a build problem though, which I opened ticket for: https://app.assembla.com/spaces/bryntum/tickets/8988-react-demo-in-trial-distribution-refers-to-scheduler-folder-which-may-not-ex/details
If during the build you will get error
File to import not found or unreadable: ../../../Scheduler/examples/_shared/shared.scss.
navigate to examples/react/javascript/basic/src/App.js and change
import 'bryntum-resources/shared.scss';
to
import 'bryntum-resources/shared.css';

Post Reply