'How to do console.log debugging on dependency packages with next.js
Running next dev, I can put a breakpoint in a browser (for example chrome) on a .js file at the following path, and the breakpoint is hit (this file is part of a package that is a dependency of the project I'm working on):
webpack-internal://
.
node_modules
ra-core/esm
dataProvider
useGetMany.js
However, I'd like instead to do some console.log debugging in that file. As it happens that file is originally a TypeScript file - but I don't mind whether I'm editing generated .js or the original .ts
The problem is that my console.logs don't seem to take effect. Having edited every copy of useGetMany.js/useGetMany.ts in node_modules, restarted the dev server, and done a hard-refresh, I still don't see my edit show up in the .js source code I see browsing through webpack-internal:// in the browser (I see this both in chrome and firefox). Nor do I see my console.log output.
These are the files I edited:
node_modules/ra-core/esm/dataProvider/useGetMany.js
node_modules/ra-core/lib/dataProvider/useGetMany.js
node_modules/ra-core/src/dataProvider/useGetMany.ts
What am I doing wrong and how can I do console.log debugging here?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
