Closed sarfata closed 4 years ago
So the can't resolve 'module'
error is because of my webpack configuration. I needed to ignore the 'module' node package like create-react-app does.
But even with that fix, I still get warnings from the other graphql-tools packages listed above and runtime issues in storybook:
TypeError: Cannot read property 'native' of undefined
at Object.../node_modules/fs-extra/lib/fs/index.js (http://localhost:9009/vendors~main.870fed89a175efef8db3.bundle.js:393787:24)
at __webpack_require__ (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:849:30)
at fn (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:151:20)
at Object.../node_modules/fs-extra/lib/index.js (http://localhost:9009/vendors~main.870fed89a175efef8db3.bundle.js:393806:6)
at __webpack_require__ (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:849:30)
at fn (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:151:20)
at Module.<anonymous> (http://localhost:9009/vendors~main.870fed89a175efef8db3.bundle.js:167709:66)
at Module.../node_modules/@graphql-tools/import/index.esm.js (http://localhost:9009/vendors~main.870fed89a175efef8db3.bundle.js:168201:30)
at __webpack_require__ (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:849:30)
at fn (http://localhost:9009/runtime~main.870fed89a175efef8db3.bundle.js:151:20)
tldr: we should merge the fix. it's very simple and I get no warnings or errors with it.
:tada: This PR is included in version 4.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I made a last minute mistake when I was cleaning up yesterday.
It's very important to not import
graphql-tools
because it references the packageresolve-from
which confuses webpack and causes an error. (We also get a ton of warnings because other parts ofgraphql-tools
use conditionals require which webpack also does not like).It's possible to make webpack ignore it but it's going to be easier for everyone if we just avoid the problem by importing the sub-pieces of graphql-tools we do need (and the sub-pieces do not refer the problematic packages).
I think with this commit message and the semantic-release gh action we should get a 4.0.1 automatically so I have not updated the version number.
For reference this is the error I get in my project when I use
apollo-mocked-provider
4.0.0 as it is now: