TypeError: (0 , _stylis.middleware) is not a function
hyochan opened this issue · comments
Which package manager are you using? (Yarn is recommended)
Yarn
Summary
After adding mjs
ext in webpack config as suggested in #863 (comment),
getRoutes.ts:298 Error loading route "./(tabs)/index.tsx" TypeError: (0 , _stylis.middleware) is not a function
![Screenshot 2023-08-29 at 12 37 57 PM](https://private-user-images.githubusercontent.com/27461460/263892026-834f74e3-040e-450a-a171-595b304f7723.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAxODU2MjIsIm5iZiI6MTcxMDE4NTMyMiwicGF0aCI6Ii8yNzQ2MTQ2MC8yNjM4OTIwMjYtODM0Zjc0ZTMtMDQwZS00NTBhLWExNzEtNTk1YjMwNGY3NzIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzExVDE5Mjg0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3MWVmMThhMTIyZjViMTFhODNjYWM3ODIxMzZkMTA1YzNjMWY5ZWRhYTRhZTRlNDUwNTY1Mzg0NTY3MDgyNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.opz7pVjzmEL2w_fpCggCtG-OJQ8LXw7Bm5YQdJuuFos)
Related Issue
I also posted issue in emotion-js/emotion#3073 and doubt that this happens in expo-router
🤔
Minimal reproducible example
I created a small repo in commit after Generated by create-expo-app 2.0.3.
in https://github.com/hyochan/expo-router-49-stylis-error-reproduction.
Oh that's unfortunate, last I tested stylis
was working with the quickfix, something must of changed since then.
Being a quickfix, its not the actual fix - that's in @expo/metro-config@next
. I tested your repo using the updated metro config package and it appears to be working. Just remove the 'quickfix' line from your config and run yarn add @expo/metro-config@next
I'm going to close this as it appears to be fixed, but you still have issues simply reply and we can reopen it.
@marklawlor Finally it is working! Thanks.
@marklawlor I am seeing another problem in my other repo which was fine in expo 48
.
![Screenshot 2023-08-29 at 5 53 41 PM](https://private-user-images.githubusercontent.com/27461460/263959549-1c89e76a-5de7-4c9a-867f-e44c78bfbccc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTAxODU2MjIsIm5iZiI6MTcxMDE4NTMyMiwicGF0aCI6Ii8yNzQ2MTQ2MC8yNjM5NTk1NDktMWM4OWU3NmEtNWRlNy00YzlhLTg2N2YtZTQ0Yzc4YmZiY2NjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAzMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMzExVDE5Mjg0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyMzNlN2Q3ZGQzZjk4N2QzMDRmZWI2YWFkOGFmYzdkZWNmMDhhMjQwNjgzNGQ1YzY5MDliNTVjNzNkZWU3ZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wfvs2pY2Qe4s2QfTNg_tYA8ESpTLHuNWfqdGaVBlDjs)
Do you have any idea how to resolve above?
ERROR in ./node_modules/@expo/metro-runtime/build/error-overlay/Data/parseLogBoxLog.js:10
Module not found: Can't resolve 'react-native/Libraries/UTFSequence'
8 |
9 | // @ts-expect-error
> 10 | import UTFSequence from "react-native/Libraries/UTFSequence";
11 |
12 | import parseErrorStack from "../modules/parseErrorStack";
13 | import stringifySafe from "../modules/stringifySafe";
ERROR in ./node_modules/@expo/metro-runtime/build/error-overlay/modules/parseErrorStack/parseHermesStack.js:1
Module not found: Can't resolve 'react-native/Libraries/Core/Devtools/parseErrorStack'
> 1 | import parseErrorStack from "react-native/Libraries/Core/Devtools/parseErrorStack";
2 |
3 | export { parseErrorStack };
4 |
ERROR in ./node_modules/expo-asset/build/Asset.js:2
Module not found: Can't resolve 'react-native/Libraries/Image/AssetRegistry'
1 | import { Platform } from 'expo-modules-core';
> 2 | import { getAssetByID } from 'react-native/Libraries/Image/AssetRegistry';
3 |
4 | import { AssetMetadata, selectAssetSource } from './AssetSources';
5 | import * as AssetUris from './AssetUris';
ERROR in ./node_modules/expo-asset/build/resolveAssetSource.web.js:1
Module not found: Can't resolve 'react-native/Libraries/Image/AssetRegistry'
> 1 | import { getAssetByID } from 'react-native/Libraries/Image/AssetRegistry';
2 |
3 | import AssetSourceResolver, { ResolvedAssetSource } from './AssetSourceResolver';
4 |
ERROR in ./node_modules/expo-image/build/utils/resolveAssetSource.web.js:1
Module not found: Can't resolve 'react-native/Libraries/Image/AssetRegistry'
> 1 | import { getAssetByID } from 'react-native/Libraries/Image/AssetRegistry';
2 |
3 | import AssetSourceResolver, { ResolvedAssetSource } from './AssetSourceResolver.web';
4 |
web compiled with 5 errors and 6 warnings
This looks like you're using Webpack again, Webpack does not support Expo Router.