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

Broken sourcemap #89

Open
tomtiao opened this issue Sep 25, 2023 · 3 comments
Open

Broken sourcemap #89

tomtiao opened this issue Sep 25, 2023 · 3 comments
Assignees
Labels
🐞 Bug Something isn't working

Comments

@tomtiao
Copy link
Contributor

tomtiao commented Sep 25, 2023

WARNING in ./node_modules/xmind/dist/core/topic.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/xxx/xxx/node_modules/xmind/src/core/topic.ts' file: Error: ENOENT: no such file or directory, open '/home/xxx/xxx/node_modules/xmind/src/core/topic.ts'
 @ ./node_modules/xmind/dist/browser.js 17:16-39
  • Cannot use debugger to step in functions of the library in browser DevTools, unless turn off Enable JavaScript source maps in the DevTools settings.

This can be fixed by

  1. publish the package with the typescript code
  2. or use inlineSources options in tsconfig to include the code in the sourcemap file
  3. or don't emit the sourcemap at all

Options 1 and 2 will both increase the published size of the package.

  • Rollup warns "Broken sourcemap" when bundling

To reproduce, run command npm run rollup. It seems that rollup-plugin-minification doesn't return the transformed sourcemap after the minification. Since the plugin is no longer maintained, consider migrating to @rollup/plugin-terser.

(!) Broken sourcemap
https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect
Plugins that transform code (such as "minification") should generate accompanying sourcemaps.

I will open a draft pr first and push fixes based on your feedback.

#88

@tomtiao tomtiao mentioned this issue Sep 25, 2023
@danielsss danielsss self-assigned this Sep 27, 2023
@danielsss danielsss added the 🐞 Bug Something isn't working label Sep 27, 2023
@danielsss
Copy link
Contributor

danielsss commented Sep 27, 2023

@tomtiao v2.2.33 has been released for RP #88

@tomtiao
Copy link
Contributor Author

tomtiao commented Oct 8, 2023

@danielsss
Sorry for the late response and for not making it clear. #88 is a partial fix. That's why it's a draft PR.

To fully fix this issue (I'm still getting the "file not found" error in DevTools and the "Broken sourcemap" warning after rollup bundling, sorry!), I suggest that there's more work to be done in the build process.

I am working on other projects at the moment and will come back another day and have a closer look at this issue. Thanks for your time!

@danielsss danielsss reopened this Oct 8, 2023
@danielsss
Copy link
Contributor

@danielsss Sorry for the late response and for not making it clear. #88 is a partial fix. That's why it's a draft PR.

To fully fix this issue (I'm still getting the "file not found" error in DevTools and the "Broken sourcemap" warning after rollup bundling, sorry!), I suggest that there's more work to be done in the build process.

I am working on other projects at the moment and will come back another day and have a closer look at this issue. Thanks for your time!

Currently, I'm busy as well and don't have much time to fix this issue.

Take your time and I appreciate what you've done before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants