React-select: Uncaught SyntaxError: Unexpected token import

Created on 9 Sep 2017  路  9Comments  路  Source: JedWatson/react-select

1.0.0-rc.6 get Unexpected token import error

Most helpful comment

Fixed in 1.0.0-rc.7

All 9 comments

same here

The lib/* files no longer have their import statements transformed to require, as of 1aa5134a1c2fd72daedabb45c2a81483c8bfeb96. See:

https://github.com/JedWatson/react-select/commit/1aa5134a1c2fd72daedabb45c2a81483c8bfeb96#diff-5c7f669d548ab8bf495256ff9bfd0acc

There are a number of other babel transformations that are no longer taking place, including let and const to var, default args, class to objects, etc.

Hmm, that's an interesting move, particularly since currently node.js doesn't support import natively. IMO to require (lol) people to transpile stuff in node_modules might be more of an inconvenience than it's worth.

Same here.

Here are the errors I get when building a docker image with Node 8.4.0.

Errors prevented bundling:
While minifying app code:
packages/minifyStdJS/plugin/minify-js.js:96:26: Babili minification error
within packages/modules.js:
node_modules/react-select/lib/Select.js, line 1167

Only one default export allowed per module.:

export default Select;

at maybeThrowMinifyErrorBySourceFile
(packages/minifyStdJS/plugin/minify-js.js:96:26)
at files.forEach.file (packages/minifyStdJS/plugin/minify-js.js:135:9)
at Array.forEach (<anonymous>)
at MeteorBabelMinifier.processFilesForBundle
(packages/minifyStdJS/plugin/minify-js.js:118:9)

@super-cache-money I'd guess it's an unintended build config issue, not an intentional change. It'd be one heck of a breaking change for a -rc.* version bump.

Was having the same issue. I can confirm that switching back to _1.0.0-rc.5_ fixed this in an isomorphic build.

Fixed in 1.0.0-rc.7

Sorry everyone, that was an unintended side-effect of the new build. We've fixed it now, should work as expected and please let us know if you see any other regressions with the rc - we'll jump on them asap and then want to get 1.0.0 out the door.

Thanks @JedWatson you are awesome! :+1:

Was this page helpful?
0 / 5 - 0 ratings