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 'visitWithTypeInfo' from non EcmaScript module (only default export is available) #4125

Closed
sibelius opened this issue Sep 5, 2018 · 7 comments

Comments

@sibelius
Copy link

sibelius commented Sep 5, 2018

I'm using 4.0.0-alpha.20, to make storybook work well with babel 7

ERROR in ./node_modules/graphql/index.mjs 64:0-70:117
Can't reexport the named export 'visitWithTypeInfo' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql-relay/lib/connection/connection.js
 @ ./node_modules/graphql-relay/lib/index.js
 @ ./src/common/utils.js

image

I'm hit this error, I think it is related to .mjs extensions, or a missing babelrc plugin

@fletcherist
Copy link

Same here

@igor-dv
Copy link
Member

igor-dv commented Sep 10, 2018

Google gave me this - graphql/graphql-js#1272 issue. I belive it's not related to us directly.

@igor-dv igor-dv closed this as completed Sep 10, 2018
@fletcherist
Copy link

@sibelius Actually I've solved this with this comment. Why not to try it out?

Actually the problem here is that Storybook can't parse .mjs modules out of box.
I think this issue should be closed.

@sibelius
Copy link
Author

@fletcherist you used a custom webpack config to achieve this?

can u share part of it?

@fletcherist
Copy link

fletcherist commented Sep 10, 2018

@sibelius of course, sure: .storybook/webpack.config.js

module.exports = (baseConfig, env, config) => {
  // ...
  config.module.rules.push({
    test: /\.mjs$/,
    include: /node_modules/,
    type: "javascript/auto",
  });
  config.resolve.extensions.push(".mjs");
  // ... Rest params
  return config;
};

@igor-dv
Copy link
Member

igor-dv commented Sep 10, 2018

@Hypnosphi, is this mjs something we would like to support by default ?

@Hypnosphi
Copy link
Member

Yes, it's node.js extension for ES modules. We should add it to resolve.extensions and to babel-loader's test.

But I have no idea what does type: "javascript/auto" mean

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

4 participants