flash-list: SyntaxError: Cannot use import statement outside a module
Current behavior
dropping in FlashList in place of a FlatList in our React Native Web project gives the error SyntaxError: Cannot use import statement outside a module
Expected behavior
no error
To Reproduce
not sure if it’s anything specific to do with our setup as the docs seem to suggest it should work on web?
Platform:
- iOS
- Android
- Web
Environment
1.0.4
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17
I’m solved this with:
I have added flash list recyclerlistview dependency and nextjs compiled without errors.
My next.config.js:
yeah, works with
next-transpile-modules
!@dhatGuy @pleaseshutup
@flygomel I did the same thing, and was able to build without errors, however, the <FlashList/> component didn’t actually render and this was in the actual render output:
ReferenceError: exports is not defined at eval (webpack-internal:///./node_modules/recyclerlistview/dist/reactnative/core/VirtualRenderer.js:3:11492)
can I see the config? I tried it adding flashlist to next-transpile-modules, still getting the error
The native components aren’t included in expo right now. Wait for one of the future revisions.
when running on iOS (managed expo) we get
Invariant Violation: requireNativeComponent: "AutoLayoutView" was not found in the UIManager.
😕