npm run build-dev giving unexpected token in index.jsx
Hi, I am getting the following error on windows 10 machine
cross-env BABEL_ENV=es rollup -c rollup.umd.config.js -i src/index.jsx -o dist/react-datepicker.js src/index.jsx → es/index.js... src/index.jsx → lib/index.js... [!] (babel plugin) SyntaxError: C:/Code/projects/ReactJS/react-datepicker/src/index.jsx: Unexpected token (73:19) src\index.jsx (73:19) [!] (babel plugin) SyntaxError: C:/Code/projects/ReactJS/react-datepicker/src/index.jsx: Unexpected token (73:19) src\index.jsx (73:19) SyntaxError: C:/Code/projects/ReactJS/react-datepicker/src/index.jsx: Unexpected token (73:19) at error (C:\Code\projects\ReactJS\react-datepicker\node_modules\rollup\dist\rollup.js:185:14) at Object.error (C:\Code\projects\ReactJS\react-datepicker\node_modules\rollup\dist\rollup.js:17543:6) at promise.then.previous (C:\Code\projects\ReactJS\react-datepicker\node_modules\rollup\dist\rollup.js:17552:32) at
at process._tickCallback (internal/process/next_tick.js:188:7) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:191:16) at bootstrap_node.js:612:3
This is the error log
10 silly lifecycle [email protected]~build-dev: Args: [ '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development run-p build:** && run-p css:**' ]
11 silly lifecycle [email protected]~build-dev: Returned: code: 1 signal: null
12 info lifecycle [email protected]~build-dev: Failed to exec build-dev script
13 verbose stack Error: [email protected] build-dev: cross-env NODE_ENV=development run-p build:** && run-p css:**
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.cross-env NODE_ENV=development run-p build:** && run-p css:**
22 error Exit status 1
23 error Failed at the [email protected] build-dev script.
Any help, I am not sure how to get it built.
I resolved the error above by adding to my .babelrc
{
"plugins": [["transform-class-properties", { "spec": true }]]
}
and got past the error to another one
babel plugin unexpected token (627,6) in index.jsx which this line <WrappedCalendar, please can anyone help. What I do not understand is that I cloned the project and did npm install then npm run build there must something wrong I am doing.
Ok this is now resolved, I was missing config.plugins line in my .babelrc I have no idea why it happened, I cloned the repo fine.