Skip to content

Source map warning when used within create-react-app v5.0.0 (webpack 5) #29

@schwolf

Description

@schwolf

Steps to reproduce:

npx create-react-app myApp

cd myApp

npm i react-script-hook

Add import to to src/App.js:
import useScript from 'react-script-hook' or import useScript from 'react-script-hook/lib/use-script'

npm run build

Result:
...
Compiled with warnings.

Failed to parse source map from '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx' file: Error: ENOENT: no such file or directory, open '/home/schwolf/dev/myApp/node_modules/react-script-hook/src/use-script.tsx'
...

This problem did not occur in in create-react-app version 4 (which was using webpack v4 under the hood)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions