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

Failed to parse source map #43

Open
luckyxhu opened this issue Dec 21, 2021 · 7 comments
Open

Failed to parse source map #43

luckyxhu opened this issue Dec 21, 2021 · 7 comments

Comments

@luckyxhu
Copy link

luckyxhu commented Dec 21, 2021

Run yarn start or yarn build output below warning:

WARNING in ./node_modules/timeago-react/esm/timeago-react.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago-react/src/timeago-react.tsx' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago-react/src/timeago-react.tsx'

WARNING in ./node_modules/timeago.js/esm/format.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/format.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/format.ts'
 @ ./node_modules/timeago.js/esm/index.js 10:0-34 10:0-34
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/index.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/index.ts'
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/lang/en_US.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/lang/en_US.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/lang/en_US.ts'
 @ ./node_modules/timeago.js/esm/index.js 5:0-33 8:18-23
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/lang/zh_CN.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/lang/zh_CN.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/lang/zh_CN.ts'
 @ ./node_modules/timeago.js/esm/index.js 6:0-33 9:18-23
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/realtime.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/realtime.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/realtime.ts'
 @ ./node_modules/timeago.js/esm/index.js 11:0-44 11:0-44 11:0-44
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/register.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/register.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/register.ts'
 @ ./node_modules/timeago.js/esm/index.js 7:0-38 8:0-8 9:0-8 12:0-20
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/utils/date.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/utils/date.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/utils/date.ts'
 @ ./node_modules/timeago.js/esm/format.js 1:0-51 12:12-19 14:9-19
 @ ./node_modules/timeago.js/esm/index.js 10:0-34 10:0-34
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

WARNING in ./node_modules/timeago.js/esm/utils/dom.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'node_modules/timeago.js/src/utils/dom.ts' file: Error: ENOENT: no such file or directory, open 'node_modules/timeago.js/src/utils/dom.ts'
 @ ./node_modules/timeago.js/esm/realtime.js 1:0-71 19:8-18 31:2-12 41:18-28 57:14-30
 @ ./node_modules/timeago.js/esm/index.js 11:0-44 11:0-44 11:0-44
 @ ./node_modules/timeago-react/esm/timeago-react.js 51:0-52 113:4-10 118:6-12 124:4-10 143:16-22

Environment

webpack 5.65.0
source-map-loader 3.0.0
node v16.13.1

@luckyxhu luckyxhu reopened this Dec 22, 2021
@alanwei0
Copy link
Collaborator

I think this is an issue of source-map-loader rather than time-ago, you could just try to ignore this warning referring to this doc.

@ErwinSteffens
Copy link

See: facebook/create-react-app#11924 (comment)

The problem is that the library's source files are being referenced but not being published, just the compiled code in the dist directory. I'm also having this issue with zod, there's an open issue about it and a PR to publish the source files which would fix the problem.

@garfieldnate
Copy link

@hustcc I would re-open this. I think you need to publish the source, otherwise it's impossible for the source maps to be applied, and any debugging that hits source in this module will be very difficult to follow.

@garfieldnate
Copy link

Also, note that this fix needs to be applied in the timeago package, as well.

@alanwei0 alanwei0 reopened this Feb 19, 2023
@Srivallabh13
Copy link

any solutions?

@moises2406
Copy link

Solution add .env GENERATE_SOURCEMAP=false

@selankon
Copy link

Solution add .env GENERATE_SOURCEMAP=false

Not worked for me. And i don't think this is an elegant solution

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

7 participants