Skip to content
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 SDK 50 Conflict: Multiple chunks emit assets to the same filename #28518

Closed
raci-aivy opened this issue Apr 29, 2024 · 1 comment
Closed
Labels
CLI Versioned Expo CLI -- `npx expo start`

Comments

@raci-aivy
Copy link

raci-aivy commented Apr 29, 2024

Summary

After I've upgraded to Expo SDK 50 I can't build web anymore with my webpack config.

The version of @expo/webpack-config increased from "0.17.4" to "^19.0.0" and with Version 19 it doesn't build anymore showing the following error:

Failed to compile
Error: Conflict: Multiple chunks emit assets to the same filename static/js/aivy.js?v=81313d90ed445df894d1 (chunks 792 and 752)

In my webpack.config.js file I'll need to setup like this and specify a static name for my output.filename:

config.output.chunkFilename = 'static/js/[id].js?v=[hash]'
config.output.filename = 'static/js/foo.js?v=[hash]'

Before that worked with the v parameter and the [hash] notation.

What platform(s) does this occur on?

Web

SDK Version

Expo SDK 50

Environment

System:
OS: macOS 13.1
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.5.1 - /opt/homebrew/bin/npm
Watchman: 2022.01.10.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/arbnorraci/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8512546
Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
npmPackages:
@expo/webpack-config: ^19.0.0 => 19.0.1
expo: ^50.0.0 => 50.0.17
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.11
npmGlobalPackages:
eas-cli: 7.8.4
expo-cli: 6.3.10
Expo Workflow: managed

Minimal reproducible example

Setup a react native web project using the Expo SDK 50 and use webpack to export the web build. You will need to specify a static filename under the config with:
config.output.filename = 'static/js/foo.js?v=[hash]'

@raci-aivy raci-aivy added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Apr 29, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label Apr 29, 2024
@byCedric
Copy link
Member

Hi @raci-aivy! Unfortunately, Webpack support has been deprecated since SDK 50 (see announcement).

That being said, file outputs will likely still collide on the disk itself. There is no query parameter in the local file system, hence I wouldn't recommend using ?v=[hash] to avoid collision. Instead, you could try using static/js/foo.[hash].js, which shouldn't collide locally.

For future reference, the webpack config has been moved outside the main repository and now lives here: https://github.com/expo/expo-webpack-integrations/blob/3ea9d5c16c004145f60d36a735301d6629f166a2/packages/webpack-config/src/webpack.config.ts#L88-L110.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Versioned Expo CLI -- `npx expo start`
Projects
None yet
Development

No branches or pull requests

3 participants