-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't import the named export 'ApolloLink' from non EcmaScript module #72
Comments
Issue changed, Ive updated |
Removing index.mjs file solves the issue, but apparently I cannot do it in real life. |
Im using webpack4 btw |
Yes, this is an issue that intersects a few different things surrounding ESM and |
This should be fixed in v7.1.0. Note that the lasting solution is for Apollo to support ESM properly, see apollographql/apollo-link#537. In the meantime, Webpack will display harmless, but annoying warnings like these due to our workarounds: |
It's actually completely failing to compile for me:
|
Got the same compile error after upgrading to |
@pcjmfranken what version of Webpack are you using? |
Relevant parts of index.js import { createUploadLink } from 'apollo-upload-client'
const apolloLinks = split(
({ query }) => {
const { kind, operation } = getMainDefinition(query)
return kind === 'OperationDefinition' && operation === 'subscription'
},
apolloWebSocketLink,
apolloUploadClientLink,
apolloHttpLink
)
const apolloClient = new ApolloClient({
cache: apolloCache,
link: ApolloLink.from([
apolloStateLink,
apolloLinks
])
}) The above code works with |
Meanwhile I import index.js file directly: |
I also get compilation errors, I'll have to roll it back for now |
I am cutting a new major release with a traditional
|
After doing following:
I have these errors when building using webpack:
Do you have any ideas in mind why I have following errors?
The text was updated successfully, but these errors were encountered: