Skip to content
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

Can't reexport the named export #82

Closed
tborychowski opened this issue Apr 23, 2019 · 2 comments
Closed

Can't reexport the named export #82

tborychowski opened this issue Apr 23, 2019 · 2 comments

Comments

@tborychowski
Copy link

tborychowski commented Apr 23, 2019

Hi,

Not exactly sure if this is an issue with the loader or svelte.
I have a very basic webpack setup (like in the official template repo).
Whenever import anything from svelte, e.g.:

import {onMount} from 'svelte';

I get a bunch of errors:

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'afterUpdate' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'beforeUpdate' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'createEventDispatcher' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'getContext' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'onDestroy' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'onMount' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'setContext' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js

ERROR in ./node_modules/svelte/index.mjs 1:0-10:20
Can't reexport the named export 'tick' from non EcmaScript module (only default export is available)
 @ ./src/App.html
 @ ./src/index.js
@EmilTholin
Copy link
Member

EmilTholin commented Apr 23, 2019

Have you manually defined the extensions array in your Webpack config? If yes, try to add .mjs before .js in that array.

@tborychowski
Copy link
Author

Thanks @EmilTholin !
That fixed it!
I wasn't using any .mjs so I thought I can remove it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants