graphql-language-service ^4.0.0 has invalid dependencies for browser
See original GitHub issueI created a small reproduction repo showing the issue: https://github.com/PabloSzx/graphiql-browser-bundle.
Basically:
Doing a browser bundle using esbuild:
esbuild --bundle --platform=browser --outdir=dist index.ts
An error is shown:
✘ [ERROR] Could not resolve "punycode"
node_modules/.pnpm/markdown-it@12.2.0/node_modules/markdown-it/lib/index.js:14:27:
14 │ var punycode = require('punycode');
╵ ~~~~~~~~~~
The package "punycode" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "--platform=node" to do that, which will remove this error.
✘ [ERROR] Could not resolve "path"
node_modules/.pnpm/picomatch@2.3.0/node_modules/picomatch/lib/picomatch.js:3:21:
3 │ const path = require('path');
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "--platform=node" to do that, which will remove this error.
✘ [ERROR] Could not resolve "path"
node_modules/.pnpm/picomatch@2.3.0/node_modules/picomatch/lib/constants.js:3:21:
3 │ const path = require('path');
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "--platform=node" to do that, which will remove this error.
✘ [ERROR] Could not resolve "path"
node_modules/.pnpm/picomatch@2.3.0/node_modules/picomatch/lib/utils.js:3:21:
3 │ const path = require('path');
╵ ~~~~~~
The package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "--platform=node" to do that, which will remove this error.
4 errors
ELIFECYCLE Command failed with exit code 1.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
NPM warnings when installing @nuxtjs/apollo - Stack Overflow
If you are: not confident with CLI commands; using NPM and not yarn (double check that you don't have any yarn.lock in your...
Read more >graphql-language-service-interface - npm
This provides the Official Language Server Protocol compliant GraphQL language service to be used by an IDE plugin, a browser application or ...
Read more >error: cannot find module 'graphql/language/parser' - You.com
I have added "@apollo/client": "3.3.6" (use latest version) as dependency in ... Our mobile browser gives you flexibility to search across different search ......
Read more >Compare Packages Between Distributions - DistroWatch.com
A complete package list for further comparison is available. ... appcenter-4.0.0 appcsxcad-unstable-2020-01-04 ... asdf-dependency-grovel-20170403-git
Read more >yarn.lock · equalll/Gatsby - Gitee.com
... dependencies: byte-size "^4.0.3" columnify "^1.5.4" has-unicode "^2.0.1" ... resolve-from "^4.0.0" graphql-language-service-interface@^1.3.2: version ...
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
I’m going to bed soon. They will be improved some day when there is time. You are free to help by proposing any improvements you see fit. Goodnight!
This is the fix for now, I will add an esbuild section to the docs for
monaco-graphql
with thishttps://esbuild.github.io/getting-started/#bundling-for-the-browser