-
Notifications
You must be signed in to change notification settings - Fork 514
"default" is not exported by NativeSkiaModule.web.js #2960
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
Comments
This is a bit of a cat and mouse game. A reproduction would be useful. I would like to understand how we can prevent these errors from happening. Did you look at #2949? We use it to make sure web support works. Maybe you can add an example there? or in |
I'll see if I can come up with a simple reproduction next week - I agree it'd be useful to be able to catch these things! My monorepo is using skia both with Expo/metro and vite as bundlers so I've hit both issues at the same time. In the meantime, I think this one is a relatively easy fix if the |
What is should the .web.ts export? Do you know why we are not hitting
this issue in the expo test project?
…On Fri, Feb 14, 2025 at 9:11 PM Sam Cooke ***@***.***> wrote:
I'll see if I can come up with a simple reproduction next week - I agree it'd be useful to be able to catch these things! My monorepo is using skia both with Expo/metro and vite as bundlers so I've hit both issues at the same time.
In the meantime, I think this one is a relatively easy fix if the .ts file has a default export and the .web.ts file doesn't?
—
Reply to this email directly, view it on GitHub or unsubscribe.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
My expo project builds without issue as well (in the same monorepo). Without knowing a huge amount about metro and esbuild's internals (which is what vite is using at build time), my assumption is that metro doesn't check if a default export is used until runtime, but esbuild does - so esbuild is statically checking for the default export and not finding it. That's why adding Hopefully that makes sense, I don't think I've explained it well! |
🎉 This issue has been resolved in version 1.11.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
I'm building a web project with vite/esbuild and I get the following error on the latest version (1.11.7):
It looks like
NativeSkiaModule.ts
has a default export (https://github.com/Shopify/react-native-skia/blob/main/packages/skia/src/specs/NativeSkiaModule.ts#L9) butNativeSkiaModule.web.ts
does not (https://github.com/Shopify/react-native-skia/blob/main/packages/skia/src/specs/NativeSkiaModule.web.ts). Patching the file withexport default {}
seems to work.I'm not sure if the best fix would be to add the default export or change how it's being imported in
NativeSetup.ts
.React Native Skia Version
1.11.7
React Native Version
0.77.0
Using New Architecture
Steps to Reproduce
My project is a complex monorepo so I don't know what the most basic repro is for it, but I'm hoping it's clear from the report what's wrong here even if it doesn't happen in metro builds. I can try to create a repro if you think that's necessary.
Snack, Code Example, Screenshot, or Link to Repository
n/a
The text was updated successfully, but these errors were encountered: