question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transpiled files in devtools in Next 11

See original GitHub issue

Current Behavior

When you run an app ( npm run nx run app:serve) with NX@12.7.2 and Next@11.x, files in the sources tab in devtools are transpiled (?) and not very helpful.

If you try it with standalone Next.js@11.x or with NX@12.7.2 and Next@10.x, everything works fine:

NX + Next 11: (notice transpiled files) Screenshot 2021-08-20 at 15 31 09

NX + Next 10: (everything is fine) Screenshot 2021-08-20 at 15 30 19

Next 11 standalone: (everything is fine) Screenshot 2021-08-20 at 15 27 59

Notice that for “everything is fine” cases it works fine for both Webpack 4 and 5. I guess the issue is specifically in NX + Next 11.

Expected Behavior

NX + Next 11 should show “normal” files in devtools.

Steps to Reproduce

Easiest way to repro would be to create a workspace with npx create-nx-workspace and create it with next app. Then downgrade next to 10.2.0 to see the difference.

I’ve created a simple repo with 3 branches:

https://github.com/laSinteZ/testing-nx-12-7/tree/next-11-1-0 – Problem is here 😃 https://github.com/laSinteZ/testing-nx-12-7/tree/next-10-2-0 – NX 12.7.2 + Next 10 (everythign is fine there) https://github.com/laSinteZ/testing-nx-12-7/tree/next-11-without-nx – Next without NX (everything is fine there)

  1. Clone it
  2. Checkout needed branch
  3. npm install
  4. npm run nx run app:serve
  5. Open devtools and observe.

I will be happy to provide more details on that matter.

Environment

NX Report complete - copy this into the issue template Node : 15.14.0 OS : darwin arm64 npm : 6.14.13

nx : Not Found @nrwl/angular : Not Found @nrwl/cli : 12.7.2 @nrwl/cypress : 12.7.2 @nrwl/devkit : 12.7.2 @nrwl/eslint-plugin-nx : 12.7.2 @nrwl/express : Not Found @nrwl/jest : 12.7.2 @nrwl/linter : 12.7.2 @nrwl/nest : Not Found @nrwl/next : 12.7.2 @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/react : 12.7.2 @nrwl/schematics : Not Found @nrwl/tao : 12.7.2 @nrwl/web : 12.7.2 @nrwl/workspace : 12.7.2 @nrwl/storybook : 12.7.2 @nrwl/gatsby : Not Found typescript : 4.3.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:6

github_iconTop GitHub Comments

7reactions
berkelmascommented, Aug 20, 2021

Also having the same issue

0reactions
bdeboncommented, Sep 6, 2022

I have a similar problem but I can’t find any solution. My project app is a react app. At the initialisation of the page, the sourcemap looks good, and soon after it is replaced by build.umd.js:3103 which is super weird. CleanShot 2022-09-06 at 16 16 22@2x

On the compilation logs, I have main.js but I don’t see the main.hot-reload.js file that is supposed to be here. At least it is on another fresh install. CleanShot 2022-09-06 at 16 17 52@2x

I tried to check all the difference in project.json between the fresh install and my own project and I can’t find any difference… I’m a little bit lost here and don’t know where to dig more…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript View Original (Non-sourced mapped) Source Files?
I have a JavaScript application which uses source mapping. i.e., there are .map files serving for each of the .js files.
Read more >
Advanced Features: Next.js Compiler
js Compiler, written in Rust using SWC, allows Next.js to transform and minify your JavaScript code for production. This replaces Babel for individual...
Read more >
How to transpile ES modules with webpack and Node.js
Learn how webpack interacts with and supports ES modules in this deep dive tutorial on transpilation in Node.js.
Read more >
Debug Angular apps in production without revealing source ...
At its core, a source map is a JSON file that contains all the necessary information to map the transpiled code back to...
Read more >
Debug a JavaScript or TypeScript app - Visual Studio (Windows)
Use Chrome Developer Tools or F12 Tools for Microsoft Edge for complex ... To find the specific code in a transpiled file, use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found