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

Adding tiny-trie package to React/ReactNative project causes multiple "Failed to parse source map" warnings. #15

Open
dmoncada opened this issue Jul 9, 2023 · 1 comment

Comments

@dmoncada
Copy link

dmoncada commented Jul 9, 2023

Problem

Adding tiny-trie to a React or React Native project causes a bunch of warnings to be thrown when starting the project:

WARNING in ./node_modules/tiny-trie/lib/BinaryString.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from './node_modules/tiny-trie/src/BinaryString.ts' file: Error: ENOENT: no such file or directory, open './node_modules/tiny-trie/src/BinaryString.ts'

WARNING in ./node_modules/tiny-trie/lib/Trie.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from './node_modules/tiny-trie/src/Trie.ts' file: Error: ENOENT: no such file or directory, open './node_modules/tiny-trie/src/Trie.ts'

# and other, similar warnings...

Repro steps

I quickly spun up this repo that's set up to repro this issue. Just clone the repo and do: npm i && npm start. Alternatively, you can set up a new React project that triggers the issue by doing:

# 1. Create the project.
npx create-react-app repro

# 2. Navigate to the project's folder.
cd repro

# 3. Install the package.
npm install tiny-trie

# 4. Import a class from the `tiny-trie` package in any source file.
# ...

# 5. Start the project.
npm start

Here's a similar issue in some other project and it's corresponding fix.

@dmoncada
Copy link
Author

dmoncada commented Jul 9, 2023

Created PR #16 to circumvent this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant