software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.43k stars 1.12k forks source link

Uncaught ReferenceError: exports is not defined #1946

Closed Snotax closed 2 months ago

Snotax commented 1 year ago

Bug

Production bundle can't be loaded when updating react-native-svg to 13.6.0. Whenever we update to 13.6.0 We get an "Uncaught ReferenceError: exports is not defined" when loading the react bundle. This does not happen on any older version of react-native-svg.

image

Environment info

Run react-native info in your terminal and copy the results here. Also, include the precise version number of this library that you are using in the project

React native info output:

├─ @babel/core@npm:7.20.5 │ ├─ Version: 7.20.5 │ │ │ └─ Dependencies │ ├─ @ampproject/remapping@npm:^2.1.0 → npm:2.2.0 │ ├─ @babel/code-frame@npm:^7.18.6 → npm:7.18.6 │ ├─ @babel/generator@npm:^7.20.5 → npm:7.20.5 │ ├─ @babel/helper-module-transforms@npm:^7.20.2 → npm:7.20.2 │ ├─ @babel/helpers@npm:^7.20.5 → npm:7.20.6 │ ├─ @babel/parser@npm:^7.20.5 → npm:7.20.5 │ ├─ @babel/template@npm:^7.18.10 → npm:7.18.10 │ ├─ @babel/traverse@npm:^7.20.5 → npm:7.20.5 │ ├─ @babel/types@npm:^7.20.5 → npm:7.20.5 │ ├─ convert-source-map@npm:^1.7.0 → npm:1.9.0 │ ├─ gensync@npm:^1.0.0-beta.2 → npm:1.0.0-beta.2 │ ├─ json5@npm:^2.2.1 → npm:2.2.1 │ ├─ semver@npm:^6.3.0 → npm:6.3.0 │ ├─ @babel/helper-compilation-targets@npm:^7.20.0 → npm:7.20.0 [b1e31] │ └─ debug@npm:^4.1.0 → npm:4.3.4 [dc0e9] │ ├─ @babel/eslint-parser@npm:7.19.1 │ ├─ Instances: 1 │ ├─ Version: 7.19.1 │ │ │ └─ Dependencies │ ├─ @nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1 → npm:5.1.1-v1 │ ├─ eslint-visitor-keys@npm:^2.1.0 → npm:2.1.0 │ └─ semver@npm:^6.3.0 → npm:6.3.0 │ ├─ @react-native-community/async-storage@npm:1.12.1 │ ├─ Instances: 1 │ ├─ Version: 1.12.1 │ │ │ └─ Dependencies │ └─ deep-assign@npm:^3.0.0 → npm:3.0.0 │ ├─ @typescript-eslint/eslint-plugin@npm:5.46.1 │ ├─ Instances: 1 │ ├─ Version: 5.46.1 │ │ │ └─ Dependencies │ ├─ @typescript-eslint/scope-manager@npm:5.46.1 → npm:5.46.1 │ ├─ @typescript-eslint/type-utils@npm:5.46.1 → npm:5.46.1 │ ├─ @typescript-eslint/utils@npm:5.46.1 → npm:5.46.1 │ ├─ debug@npm:^4.3.4 → npm:4.3.4 │ ├─ ignore@npm:^5.2.0 → npm:5.2.1 │ ├─ natural-compare-lite@npm:^1.4.0 → npm:1.4.0 │ ├─ regexpp@npm:^3.2.0 → npm:3.2.0 │ ├─ semver@npm:^7.3.7 → npm:7.3.8 │ └─ tsutils@npm:^3.21.0 → npm:3.21.0 │ ├─ @typescript-eslint/parser@npm:5.46.1 │ ├─ Instances: 1 │ ├─ Version: 5.46.1 │ │ │ └─ Dependencies │ ├─ @typescript-eslint/scope-manager@npm:5.46.1 → npm:5.46.1 │ ├─ @typescript-eslint/types@npm:5.46.1 → npm:5.46.1 │ ├─ @typescript-eslint/typescript-estree@npm:5.46.1 → npm:5.46.1 │ └─ debug@npm:^4.3.4 → npm:4.3.4 │ ├─ eslint-config-prettier@npm:8.5.0 │ ├─ Instances: 1 │ ├─ Version: 8.5.0 │ │ │ └─ Exported Binaries │ └─ eslint-config-prettier │ ├─ eslint-plugin-react-native@npm:4.0.0 │ ├─ Instances: 1 │ ├─ Version: 4.0.0 │ │ │ └─ Dependencies │ ├─ @babel/traverse@npm:^7.7.4 → npm:7.20.5 │ └─ eslint-plugin-react-native-globals@npm:^0.1.1 → npm:0.1.2 │ ├─ eslint-plugin-react@npm:7.31.11 │ ├─ Instances: 1 │ ├─ Version: 7.31.11 │ │ │ └─ Dependencies │ ├─ array-includes@npm:^3.1.6 → npm:3.1.6 │ ├─ array.prototype.flatmap@npm:^1.3.1 → npm:1.3.1 │ ├─ array.prototype.tosorted@npm:^1.1.1 → npm:1.1.1 │ ├─ doctrine@npm:^2.1.0 → npm:2.1.0 │ ├─ estraverse@npm:^5.3.0 → npm:5.3.0 │ ├─ jsx-ast-utils@npm:^2.4.1 || ^3.0.0 → npm:3.3.3 │ ├─ minimatch@npm:^3.1.2 → npm:3.1.2 │ ├─ object.entries@npm:^1.1.6 → npm:1.1.6 │ ├─ object.fromentries@npm:^2.0.6 → npm:2.0.6 │ ├─ object.hasown@npm:^1.1.2 → npm:1.1.2 │ ├─ object.values@npm:^1.1.6 → npm:1.1.6 │ ├─ prop-types@npm:^15.8.1 → npm:15.8.1 │ ├─ resolve@patch:resolve@^2.0.0-next.3#~builtin<compat/resolve> → patch:resolve@npm%3A2.0.0-next.4#~builtin<compat/resolve>::version=2.0.0-next.4&hash=07638b │ ├─ semver@npm:^6.3.0 → npm:6.3.0 │ └─ string.prototype.matchall@npm:^4.0.8 → npm:4.0.8 │ ├─ eslint@npm:8.29.0 │ ├─ Version: 8.29.0 │ │ │ ├─ Exported Binaries │ │ └─ eslint │ │ │ └─ Dependencies │ ├─ @eslint/eslintrc@npm:^1.3.3 → npm:1.3.3 │ ├─ @humanwhocodes/config-array@npm:^0.11.6 → npm:0.11.8 │ ├─ @humanwhocodes/module-importer@npm:^1.0.1 → npm:1.0.1 │ ├─ @nodelib/fs.walk@npm:^1.2.8 → npm:1.2.8 │ ├─ ajv@npm:^6.10.0 → npm:6.12.6 │ ├─ chalk@npm:^4.0.0 → npm:4.1.2 │ ├─ cross-spawn@npm:^7.0.2 → npm:7.0.3 │ ├─ doctrine@npm:^3.0.0 → npm:3.0.0 │ ├─ escape-string-regexp@npm:^4.0.0 → npm:4.0.0 │ ├─ eslint-scope@npm:^7.1.1 → npm:7.1.1 │ ├─ eslint-visitor-keys@npm:^3.3.0 → npm:3.3.0 │ ├─ espree@npm:^9.4.0 → npm:9.4.1 │ ├─ esquery@npm:^1.4.0 → npm:1.4.0 │ ├─ esutils@npm:^2.0.2 → npm:2.0.3 │ ├─ fast-deep-equal@npm:^3.1.3 → npm:3.1.3 │ ├─ file-entry-cache@npm:^6.0.1 → npm:6.0.1 │ ├─ find-up@npm:^5.0.0 → npm:5.0.0 │ ├─ glob-parent@npm:^6.0.2 → npm:6.0.2 │ ├─ globals@npm:^13.15.0 → npm:13.19.0 │ ├─ grapheme-splitter@npm:^1.0.4 → npm:1.0.4 │ ├─ ignore@npm:^5.2.0 → npm:5.2.1 │ ├─ import-fresh@npm:^3.0.0 → npm:3.3.0 │ ├─ imurmurhash@npm:^0.1.4 → npm:0.1.4 │ ├─ is-glob@npm:^4.0.0 → npm:4.0.3 │ ├─ is-path-inside@npm:^3.0.3 → npm:3.0.3 │ ├─ js-sdsl@npm:^4.1.4 → npm:4.2.0 │ ├─ js-yaml@npm:^4.1.0 → npm:4.1.0 │ ├─ json-stable-stringify-without-jsonify@npm:^1.0.1 → npm:1.0.1 │ ├─ levn@npm:^0.4.1 → npm:0.4.1 │ ├─ lodash.merge@npm:^4.6.2 → npm:4.6.2 │ ├─ minimatch@npm:^3.1.2 → npm:3.1.2 │ ├─ natural-compare@npm:^1.4.0 → npm:1.4.0 │ ├─ optionator@npm:^0.9.1 → npm:0.9.1 │ ├─ regexpp@npm:^3.2.0 → npm:3.2.0 │ ├─ strip-ansi@npm:^6.0.1 → npm:6.0.1 │ ├─ strip-json-comments@npm:^3.1.0 → npm:3.1.1 │ ├─ text-table@npm:^0.2.0 → npm:0.2.0 │ ├─ debug@npm:^4.1.0 → npm:4.3.4 [dc0e9] │ └─ eslint-utils@npm:^3.0.0 → npm:3.0.0 [289be] │ ├─ gt10-frontend@workspace:. │ ├─ Version: 0.0.1 │ │ │ └─ Dependencies │ ├─ @babel/core@npm:^7.20.5 → npm:7.20.5 │ ├─ eslint@npm:^8.29.0 → npm:8.29.0 │ ├─ prettier@npm:^2.8.1 → npm:2.8.1 │ ├─ typescript@patch:typescript@^4.9.4#~builtin<compat/typescript> → patch:typescript@npm%3A4.9.4#~builtin<compat/typescript>::version=4.9.4&hash=701156 │ ├─ ultra-runner@npm:^3.10.5 → npm:3.10.5 │ ├─ @babel/eslint-parser@npm:^7.19.1 → npm:7.19.1 [5e60f] │ ├─ @react-native-community/async-storage@npm:^1.12.1 → npm:1.12.1 [5e60f] │ ├─ @typescript-eslint/eslint-plugin@npm:^5.46.0 → npm:5.46.1 [5e60f] │ ├─ @typescript-eslint/parser@npm:^5.46.0 → npm:5.46.1 [5e60f] │ ├─ eslint-config-prettier@npm:^8.5.0 → npm:8.5.0 [5e60f] │ ├─ eslint-plugin-react-native@npm:^4.0.0 → npm:4.0.0 [5e60f] │ ├─ eslint-plugin-react@npm:^7.31.11 → npm:7.31.11 [5e60f] │ ├─ react-native-safe-area-context@npm:^4.4.1 → npm:4.4.1 [5e60f] │ └─ recoil@npm:^0.7.6 → npm:0.7.6 [5e60f] │ ├─ prettier@npm:2.8.1 │ ├─ Version: 2.8.1 │ │ │ └─ Exported Binaries │ └─ prettier │ ├─ react-native-safe-area-context@npm:4.4.1 │ ├─ Instances: 1 │ └─ Version: 4.4.1 │ ├─ recoil@npm:0.7.6 │ ├─ Instances: 1 │ ├─ Version: 0.7.6 │ │ │ └─ Dependencies │ └─ hamt_plus@npm:1.0.2 → npm:1.0.2 │ ├─ typescript@patch:typescript@npm%3A4.9.4#~builtin<compat/typescript>::version=4.9.4&hash=701156 │ ├─ Version: 4.9.4 │ │ │ └─ Exported Binaries │ ├─ tsc │ └─ tsserver │ └─ ultra-runner@npm:3.10.5 ├─ Version: 3.10.5 │ ├─ Exported Binaries │ └─ ultra │ └─ Dependencies ├─ ansi-split@npm:^1.0.1 → npm:1.0.1 ├─ chalk@npm:^4.1.0 → npm:4.1.2 ├─ cross-spawn@npm:^7.0.3 → npm:7.0.3 ├─ fast-glob@npm:^3.2.5 → npm:3.2.12 ├─ globrex@npm:^0.1.2 → npm:0.1.2 ├─ ignore@npm:^5.1.8 → npm:5.2.1 ├─ json5@npm:^2.2.0 → npm:2.2.1 ├─ micro-memoize@npm:^4.0.9 → npm:4.0.14 ├─ npm-run-path@npm:4.0.1 → npm:4.0.1 ├─ pid-cwd@npm:^1.2.0 → npm:1.2.0 ├─ ps-list@npm:^7.2.0 → npm:7.2.0 ├─ shellwords-ts@npm:^3.0.0 → npm:3.0.1 ├─ string-width@npm:^4.2.0 → npm:4.2.3 ├─ tslib@npm:2.1.0 → npm:2.1.0 ├─ type-fest@npm:^0.21.2 → npm:0.21.3 ├─ wrap-ansi@npm:^7.0.0 → npm:7.0.0 ├─ yamljs@npm:^0.3.0 → npm:0.3.0 └─ yargs@npm:^16.2.0 → npm:16.2.0

Library version: 13.6.0

bohdanprog commented 3 months ago

Hello @Snotax, Can you share a simple example to reproduce that issue? Thank you