Open losintikfos opened 2 years ago
I have same problem when using storybook and writing story for component that includes some icon (for example <Ionicons/>
Hitting this error as well.
UPDATE
We are getting this error when we upgraded from "@expo/next-adapter": "4.0.13"
to "@expo/next-adapter": "5.0.0"
I have the same I issue here, any updates
+1 on this; anyone find a work around?
@losintikfos any updates?
i can't believe that after a year of opening this, people (including me) are still not finding a solution!
i tried every next.config.js transpile with no success
+1...
Downgrading to @expo/next-adapter v4.0.13 doesn't seem to fix this. Are there really no solutions for this out there?
It seems without a proper fix, the lot of you might've found a work around? Any suggestions?
I am still getting this error
Same issue here, if anyone finds a workaround for this please share
I am also experiencing this problem.
I faced the same issue using :
"expo": "^49.0.0"
"react": "18.2.0"
"next": "^14.0.3"
Only on web, native seems to run fine. From what I gathered, I believe upgrading to "@expo/next-adapter": "^5.0.2"
was what triggered the issue for me.
I finally got it working after banging my head in several walls. The root cause is still unclear to me and I can't claim the workaround is perfect at all, but hopefully it can help :
Again, this workaround targets your web stack, assuming the native one is running fine.
react-native-vector-icons
yarn add react-native-vector-icons
next.config.js
file :
const nextConfig = {
webpack: (config, options) => {
config.resolve.alias = {
...(config.resolve.alias || {}),
'react-native$': 'react-native-web',
'@expo/vector-icons': 'react-native-vector-icons',
}
config.module.rules.push({
test: /\.ttf$/,
type: 'asset/resource',
})
return config
},
transpilePackages: [
'react-native',
'react-native-web',
// Whatever modules you already transpile, the important part is to add react-native-vector-icons
'react-native-vector-icons',
],
}
module.exports = withExpo(nextConfig)
**At this point, you should be able to run Next.** However, icons are not loaded. We solve that in step 3.
3. Edit your `_app.tsx` (or `.jsx`)
Import the icon font(s) you intend to use :
import iconFont from 'react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf'
const iconFontStyles = @font-face { src: url(${iconFont}); font-family: MaterialCommunityIcons; }
And add the font-face declaration in your `<Head>` component :
Any idea why I am getting below error during
npm run dev
. Usingreact: ^18.2.0
,next: ^12.2.0
and@expo/vector-icons: ^13.0.0
.