-
Notifications
You must be signed in to change notification settings - Fork 2
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
@expo/webpack-config@18.1.1 doesn't support expo@49.0.0 #16
Comments
I'm having the same error. I tried just removing the line:
I can read here: https://blog.expo.dev/expo-sdk-49-c6d398cdf740 that it's recommended to use Metro instead: It says:
|
I'm having the same issue |
As @zethzeth said, Metro is now the recommended bundler for web.
|
Is there documentation to help existing projects using webpack-config migrate to metro? We have quite a lot of custom webpack config code (import aliasing, env and template injection, etc.) and web server code that we'll need to migrate, and it'll help to have some guidance form the developers. It also looks like switching from webpack to metro requires switching to expo router (else you lose hot reloading on web), which is a massive change for those using other navigation frameworks (such as react navigation). Seems like we'll need some guidance from the developers. |
It was pretty easy to move to Metro instead,
|
Different symptoms, same root cause: Seems like either webpack-config should support latest version of expo, or the doc should be updated in some form (perhaps the best being to be changed to have metro web bundling instructions since that's what SDK 49 recommends) |
Oof rough first day working with Expo. The starter docs lead you right to a failed build. For new projects modifying this in "expo": {
"web": {
"bundler": "metro",
}
} |
Also first day with Expo. On step 3: |
Any update? We have some special webpack configs which are not supported with metro. |
I shifted the my project to metro bundler it's on SDK 49 I am facing issues with AWS Amplify now, the error says |
Just try this: const { getDefaultConfig } = require('expo/metro-config') const config = getDefaultConfig(__dirname) module.exports = { |
Can you please tell where exactly to add this? |
You have to create a metro-config.js |
thankyou sir, it is working as expected now 🙏 |
i got error for /(/amplify/.*)$/ its say Expression expected. and Identifier expected. |
|
ok it work now, thanks sir |
but even it work i still got error Unable to resolve "graphql" from "node_modules@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider\index.js" |
my dependencies: |
please anyone help me with this error. thanks |
Metro doesn't have support for workbox-webpack-plugin which we rely on for building PWA with offline support. Any workaround for this ? Any planed date for supporting Webpack again ? |
I tinkered around with expo for a whole month then got fed up it, it’s not
at all ready for production and is bad.
Now I switched over to using capacitor with react web, it works wonderfully
and helps me to achieve my goals easily much better than what expo or react
native could have done.
…On Wed, 9 Aug 2023 at 9:14 PM, Albi ***@***.***> wrote:
Metro doesn't have support for workbox-webpack-plugin which we rely on for
building PWA with offline support. Any workaround for this ? Any planed
date for supporting Webpack again ?
—
Reply to this email directly, view it on GitHub
<#16>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHF6AJIQ6W7NAYXFWND2IGLXUOV4VANCNFSM6AAAAAA2ALYO6E>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Has anyone else been able to get hot reloading working on web while using metro without the expo navigation library? We're using react-navigation and hot reloading stopped working for us after switching to metro. The example expo app also doesn't hot reload on web. Hot reloading is quite an important piece of functionality to lose in my opinion. We also have a lot of custom webpack server and HTML code that we haven't been able to migrate to metro as there doesn't seems to be any documentation on how to do this (at least not any that I've found). I feel that the Metro builder for web it's production ready yet, and I'd really like to hear from the developers what their plans around it is. |
npx expo install react-dom react-native-web @expo/webpack-config -- --legacy-peer-deps |
try this
|
I'll see if this does the trick, but installing legacy dependencies on a new enterprise system feels wrong. |
I don't know. i just had the same problem .. after many attempts, this command work for me |
How do I get the config in babel to determine when to use react-native and when to use react-native-web? By adding the alias there I make it work on the web but break native. |
I also get the error |
Any update on this from the devs? |
try this guys npx create-expo-app AwesomeProject This is will work with you |
did you find out how to fix it? |
Thanks for this! Is |
I also had the error: metro.config.js /* eslint-env node */
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
config.resolver.sourceExts.push("cjs");
config.resolver.sourceExts.push("mjs"); // <-- added this
module.exports = config; |
I understand that For example,
|
In addition to my comment above, it does look like |
After adding Metro as a bundler in app.json, make sure to include the line |
This will be super useful! Will definitely give it a try. @ChamaraWP do you know how to access environment variables in the |
Unfortunately, no. but have you tried this , it says "Environment variables prefixed with EXPO_PUBLIC_ will be exposed to the app at build-time." We don't have a folder structure called 'public', but I've seen it in many places. What purpose does it serve? What kind of files do you have there? For example, when you build, does it take 'public/index.html' as the entry point or something else? |
We have moved over to the new env variable structure (prefixing vars with EXPO_PUBLIC_XXX) and it seems to work within the app itself. The purpose of the You can generate this |
have you tried to use P.S: This how we access env from HTML |
I'll definitely give this a try. Has this worked for you with expo env vars (i.e. |
@ChamaraWP I've tried all possible combinations I can think of by we haven't been able to access env variables in the
But none of it worked. Any other ideas? I made an issue on the Metro repo here if you'd like to keep an eye on it. |
Summary
When trying to upgrade to expo 49, we receive the following error when running
npm i
:Having a look at @expo/webpack-config, it still require expo 48:
Environment
Please specify your device/emulator/simulator platform, model and version
All
Error output
Reproducible demo or steps to reproduce from a blank project
Simply trying to install expo@49.0.0 with @expo/webpack-config@18.1.1 installed will reproduce the error.
The text was updated successfully, but these errors were encountered: