Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
"type": "module"
to @apollo/client/core
Consider trying to load `@apollo/client/core` in node.js ```bash node -v # 16.3.0 ``` ```js // server/index.js import { ApolloClient } from '@apollo/client/core'; ``` > import { ApolloClient, InMemoryCache } from '@apollo/client/core/index.js'; > ^^^^^^^^^^^^ > SyntaxError: Named export 'ApolloClient' not found. The requested module '@apollo/client/core/index.js' is a CommonJS module, which may not support all module.exports as named exports. > CommonJS modules can always be imported via the default export, for example using: ```js import AC from '@apollo/client/core'; const { ApolloClient } = AC; ``` > (node:35704) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. > (Use `node --trace-warnings ...` to show where the warning was created) > /path/to/node_modules/@apollo/client/core/index.js:1 > export { ApolloClient, mergeOptions, } from "./ApolloClient.js"; > ^^^^^^ > > SyntaxError: Unexpected token 'export' adding `"type": "module"` to core will solve those errors nicely
- Loading branch information