-
-
Notifications
You must be signed in to change notification settings - Fork 42
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 import the named export 'parse' from non EcmaScript module #62
Comments
Hey, thank you :) This is a problem with Webpack. They've gone rogue & employed their own, non-spec-compliant resolution algorithm & are happy to do so because – I guess – they think they're popular enough & can just do whatever they want. That That said, you can still force Webpack to load the correct file(s) via its const path = require('path');
module.exports = {
//...
resolve: {
alias: {
regexparam: require.resolve('regexparam'),
},
},
}; Lemme know if that does the trick! |
Thank you so much for the quick response @lukeed! Webpack can be such a pain indeed... I didn't get that snippet to work immediately but it definitely pointed me to the right direction. I fiddled around with the module.exports = {
target: 'webworker',
entry: './index.js',
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
} Back to the fun stuff now. Thanks again! |
Ah, hah, so it's the age-old |
This works too! |
Awesome, thank you. Now have two snippets I can refer Webpack users to 😉 Thanks! |
@lukeed When switching away from Webpack, what "type" do you recommend, and what's needed in order to migrate away from webpack? In my
If I set it to type "javascript" I get:
For now the only solution is to default back to using webpack with a custom |
Hi @lukeed. First of all, thank you for worktop! Using this feels like a dream compared to what I was putting together before when working with Cloudflare workers.
I was following along this Fauna tutorial and ran into the following issue when running
wrangler dev
(andwrangler publish
). I noticed that this error only triggers for v0.7.0 and that using v.0.6.3 does not trigger the error and the project runs fine.Do you know what the problem might be? I'm not using TypeScript and my node version is v15.2.1. This was a pretty minimal project as described in the tutorial but please let me know if you want me to create a repo that can recreate the error.
Edit: Just want to add that I have tried this in another project without
faunadb
andworktop
is the only dependency.The text was updated successfully, but these errors were encountered: