Source Map Loading Errors
michaelryancaputo opened this issue · comments
Hey there, im getting some errors with respect to this module. im not sure if it's related to the version of react-router im using:
react-router-dom: ^6.3.0
Failed to parse source map from '/src/node_modules/react-router-prompt/src/hooks/use-blocker.ts' file: Error: ENOENT: no such file or directory, open '/src/node_modules/react-router-prompt/src/hooks/use-blocker.ts'
Failed to parse source map from '/src/node_modules/react-router-prompt/src/hooks/use-confirm.ts' file: Error: ENOENT: no such file or directory, open '/src/node_modules/react-router-prompt/src/hooks/use-confirm.ts'
Failed to parse source map from '/src/node_modules/react-router-prompt/src/index.tsx' file: Error: ENOENT: no such file or directory, open '/src/node_modules/react-router-prompt/src/index.tsx'
Looking at the folder structure in node_modules
it looks like maybe the files are not present in the module:
Thanks @michaelryancaputo for reporting issue.
I will check this issue and update accordingly.
Meanwhile can you also share the code snippet how you are using?
Sure thing:
import ReactRouterPrompt from "react-router-prompt";
///
/// Some code...
///
<ReactRouterPrompt when={onPromptBeforeNavigation}>
{({ isActive, ...rest }) =>
isActive && <ConfirmationPrompt {...rest} />
}
</ReactRouterPrompt>
@michaelryancaputo are you using CRA?
Can you check if this issue is related to facebook/create-react-app#11767 and use "start": "GENERATE_SOURCEMAP=false react-scripts start",
meanwhile i will fix the sourcemaps?
Also I tried creating codesandbox using react-router-dom v6.3.0 and it works fine there
Refer: https://codesandbox.io/s/react-router-prompt-example-zv3zt5?file=/src/App.js
@michaelryancaputo This is fixed now. Do let me know if you face this issue again we can reopen. Thanks for reporting issue !