Skip to content
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

ApolloLink export is undefined since 3.5 #9143

Closed
DanielFGray opened this issue Nov 30, 2021 · 6 comments
Closed

ApolloLink export is undefined since 3.5 #9143

DanielFGray opened this issue Nov 30, 2021 · 6 comments

Comments

@DanielFGray
Copy link

DanielFGray commented Nov 30, 2021

Intended outcome:

I'm building a custom link using

import { ApolloLink } from '@apollo/client'
class MyLink extends ApolloLink {}

Actual outcome:

in v3.4.17 it works fine, but in 3.5 it is undefined

TypeError: Class extends value undefined is not a constructor or null

the types are fine, but console.log(ApolloLink) prints undefined

How to reproduce the issue:

Downgrade to 3.4.x and it works fine
upgrade to 3.5 and it is undefined

@DanielFGray DanielFGray changed the title ApolloLink export is undefined since in 3.5 ApolloLink export is undefined since 3.5 Nov 30, 2021
@benjamn
Copy link
Member

benjamn commented Dec 1, 2021

@DanielFGray What bundler are you using? Can you provide a small reproduction?

@hwillson
Copy link
Member

hwillson commented Jan 4, 2022

We haven't heard back regarding our question in #9143 (comment) so we'll close this off.

@hwillson hwillson closed this as completed Jan 4, 2022
@CarsonF
Copy link
Contributor

CarsonF commented Jan 7, 2022

I just hit this as well. 4 days too late apparently haha. I'm still on webpack 4.46... Continuing to dig.

Edit: Ok figured out my problem. FileLoader wasn't configured to exclude .cjs files, so webpack thought it was a raw file instead of js code to resolve/load.
@DanielFGray maybe this is your problem too.

@inakineitor
Copy link

@CarsonF Hi! How did you configure FileLoader? I followed your suggestion by adding cjs to source extensions instead of asset extensions but it is not working for me.

image

@CarsonF
Copy link
Contributor

CarsonF commented Jan 10, 2023

You'll have to consult expo/metro docs. I'm not even sure that uses Webpack.
Maybe facebook/metro#535 will help?

@inakineitor
Copy link

Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants