absinthe-graphql / absinthe-socket

Core JavaScript support for Absinthe WS-based operations
MIT License
149 stars 75 forks source link

Compile errors with react-scripts 5.0.1 #65

Open ivanAlfonsoVillaVazquez opened 2 years ago

ivanAlfonsoVillaVazquez commented 2 years ago

Hi,

After updating to react-scripts 5.0.1 I had a brunch of erros like these:

Attempted import error: 'print' is not exported from 'graphql' (imported as 'print').
ERROR in ./node_modules/@absinthe/socket-apollo-link/dist/index.js 31:15-20
export 'print' (imported as 'print') was not found in 'graphql' (module has no exports)

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 34:0-49
Module not found: Error: Can't resolve './graphql' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'graphql.mjs'?
BREAKING CHANGE: The request './graphql' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 36:0-58:50
Module not found: Error: Can't resolve './type' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './type' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 60:0-68:205
Module not found: Error: Can't resolve './language' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './language' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 70:0-101
Module not found: Error: Can't resolve './execution' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './execution' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 71:0-68
Module not found: Error: Can't resolve './subscription' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './subscription' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 73:0-77:675
Module not found: Error: Can't resolve './validation' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './validation' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 79:0-64
Module not found: Error: Can't resolve './error' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './error' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/@absinthe/socket-apollo-link/node_modules/graphql/index.mjs 81:0-144:42
Module not found: Error: Can't resolve './utilities' in '/Users/ivanvilla/Documents/git/kor-frontend/node_modules/@absinthe/socket-apollo-link/node_modules/graphql'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request './utilities' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I think that this errors are related to thee new version of Webpack.

kyleboe commented 1 year ago

I am running into this as well. It looks like the bump to Webpack 5 in react-scripts is causing this.

jzwood commented 1 year ago

yeah, same issue for us too 😕.

kyleboe commented 1 year ago

@jzwood I'd recommend checking out the discussion here: https://github.com/absinthe-graphql/absinthe-socket/issues/66. It seems like this library is unnecessary if you are using a modern version of the @apollo/client.