-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected token in MathUtil.js #15
Comments
AFAICT this is because we publish ES6 modules on npm which aren't understood by CRA. Ping @KaiVolland, correct? Can we publish ES5 additionally? Can you link to your remarks wrt ejecting etc.? TIA |
I think this is related: terrestris/react-geo#851 (comment) |
@jelmervdl If there is something we can do on our side to make this usable for e.g. CRA and still publish valid ES6, I'd say PRs very much welcome. A notice on the readme might also help in the meantime. Thanks in advance. |
We might shoukld switch to ES5. Seems to cause a lot of problems. |
As we have just discussed, please try to provide a solution with ES6 and ES5 next to each other. |
A possible solution to avoid transpiling error in CRA based projects is to force including of affected dependencies to be used with {
test: /\.(js|jsx|mjs)$/,
include: [
paths.appSrc,
path.resolve(paths.appNodeModules, '@terrestris/base-util'),
path.resolve(paths.appNodeModules, '@terrestris/ol-util')
[...]
],
loader: require.resolve('babel-loader'),
options: {...},
}, s. also facebook/create-react-app#1125 (comment) This fixed the failing build of CRA app in some another project for me. |
As of version 0.1.2 we publish both |
Hi,
When trying to include the react-geo module, the build breaks on an unexpected token in MathUtil.js. The static variables are not being accepted. When I convert them to true static methods, they compile as expected.
Node v10.8.0, after creating a react app via
yarn create react-app my-app
.(The same happens in MapUtil.js of the ol-util module by the way. I can create pull requests for both if appreciated 😄 )
The text was updated successfully, but these errors were encountered: