expo / expo-webpack-integrations

Packages used to integrate Expo in Webpack-based projects.
8 stars 2 forks source link

SVG filenames may not be correctly output when using @expo/webpack-config #31

Open tmizu23 opened 2 months ago

tmizu23 commented 2 months ago

Summary

When executing 'yarn build:web', SVG files output to the media folder sometimes have filenames that begin with a dot, such as '.a9dc1add32096b076313.svg'. As a result, these files are treated as special files and cannot be loaded by the browser, causing 404 or 500 errors.

Environment

expo-env-info 1.2.0 environment info: System: OS: macOS 14.5 Shell: 5.9 - /bin/zsh Binaries: Node: 18.18.0 - ~/.anyenv/envs/nodenv/versions/18.18.0/bin/node Yarn: 3.6.4 - ~/.npm-global/bin/yarn npm: 9.8.1 - ~/.anyenv/envs/nodenv/versions/18.18.0/bin/npm Managers: CocoaPods: 1.15.2 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0 Android SDK: Android NDK: 22.1.7171670 IDEs: Android Studio: 2023.3 AI-233.14808.21.2331.11842104 Xcode: 15.0/15A240d - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ~19.0.1 => 19.0.1 expo: ~51.0.21 => 51.0.21 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.74.3 => 0.74.3 react-native-web: ^0.19.12 => 0.19.12 Expo Workflow: bare

Please specify your device/emulator/simulator platform, model and version

macOS 14.5

Error output

No response

Reproducible demo or steps to reproduce from a blank project

  1. install maplibre-gl and react-map-gl and create app
  2. yarn build:web
  3. check svg filename in the web-build/static/media/ folder
tmizu23 commented 2 months ago

It appears that this issue occurs when the [name] is blank. The problem was resolved by changing the dot to an underscore, using '[name]_[hash][ext]' instead. I don't know why '[name]' becomes blank.

[[#](https://github.com/expo/expo-webpack-integrations/blob/3ea9d5c16c004145f60d36a735301d6629f166a2/packages/webpack-config/src/webpack.config.ts#L82C2-L82C60)](https://github.com/expo/expo-webpack-integrations/blob/3ea9d5c16c004145f60d36a735301d6629f166a2/packages/webpack-config/src/webpack.config.ts#L76)