Cannot build with webpack
See original GitHub issueI’m trying to bundle graphiql which uses codemirror-graphql which uses graphql-language-service.
The build is failing because webpack can’t parse the bundled js.flow
files, and it is trying to parse those because of the dynamic import at https://github.com/graphql/graphql-language-service/blob/master/packages/graphql-language-service-interface/src/GraphQLLanguageService.js#L87 (probably) which could be importing anything at all.
Is it not possible to limit the require by making it something like:
require(`./${somePath}.js`)
?
If not, is it possible to not include the flow js files in the dist
folder?
The webpack error is:
Module parse failed: .../node_modules/graphql-language-service-interface/dist/getOutline.js.flow Unexpected token (11:12)
You may need an appropriate loader to handle this file type.
| */
|
| import type {
| Outline,
| TextToken,
@ ./node_modules/graphql-language-service-interface/dist ^.*$
@ ./node_modules/graphql-language-service-interface/dist/GraphQLLanguageService.js
@ ./node_modules/graphql-language-service-interface/dist/index.js
@ ./node_modules/codemirror-graphql/lint.js
@ ./node_modules/graphiql/dist/components/QueryEditor.js
@ ./node_modules/graphiql/dist/components/GraphiQL.js
@ ./node_modules/graphiql/dist/index.js
@ ./lib/universal/Graphql/index.jsx
@ ./lib/universal/Root.jsx
@ ./lib/client/index.js
@ multi babel-polyfill stratokit/client
Issue Analytics
- State:
- Created 6 years ago
- Reactions:24
- Comments:31 (19 by maintainers)
Top Results From Across the Web
Cannot Build in Webpack without odd error - Stack Overflow
I'm using Webpack to build a very simple, small tutorial with ReactJS and JSX code. I'm getting an error I don't understand.
Read more >Cannot build webpack example for production #2266 - GitHub
Hi, I am trying to build the deck.gl react-webpack-2 get-started example for production and I am running into the following issue: Actual ...
Read more >Webpack 5 Adoption - Next.js
Using webpack 5 in your application has many benefits, notably: Improved Disk Caching: next build is significantly faster on subsequent builds ...
Read more >compression-webpack-plugin - npm
Prepare compressed versions of assets to serve them with Content-Encoding. Latest version: 10.0.0, last published: 7 months ago.
Read more >Webpack 5 errors | ImmutableX Documentation
The reason for this error is that create-react-app uses a version of webpack greater than 5, which, unlike versions < 5, does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For now I worked around it by using this as a webpack plugin:
but of course this is far from ideal. Isn’t there a better approach than this dynamic require?
How is this still thing? geez