PowerBI-visuals-tools: Error: Can't resolve 'process/browser'
When using 3.1.19 I’m getting the following error:
ERROR Failed to compile with 1 errors 11:17:18
error in ./node_modules/axios/lib/defaults.js
Module not found: Error: Can't resolve 'process/browser' in 'C:\Code\accoPLANNING\Visual\node_modules\axios\lib'
× 「wdm」: assets by status 4.58 MiB [cached] 6 assets
Entrypoint visual.js = visual.css visual.js 2 auxiliary assets
orphan modules 43.6 KiB [orphan] 29 modules
runtime modules 1.25 KiB 6 modules
modules by path ./node_modules/core-js/ 417 KiB 439 modules
modules by path ./node_modules/@microsoft/ 456 KiB 88 modules
modules by path ./node_modules/validatorjs/src/ 249 KiB 56 modules
modules by path ./node_modules/axios/ 41.2 KiB 27 modules
modules by path ./node_modules/@accobat/accotool.js/ 9.23 KiB 5 modules
modules by path ./node_modules/uuid/dist/esm-browser/*.js 3.24 KiB 5 modules
modules by path ./src/ 171 KiB 3 modules
modules by path ./node_modules/powerbi-visuals-utils-dataviewutils/lib/*.js 5.53 KiB 3 modules
css modules 274 KiB
css ../../../Users/jip/AppData/Roaming/npm/node_modules/powerbi-visuals-tools/node_modules/css-loader/dist/cjs.js!./node_modules/flexmonster/flexmonster.css 272 KiB [code generated]
css ../../../Users/jip/AppData/Roaming/npm/node_modules/powerbi-visuals-tools/node_modules/css-loader/dist/cjs.js!../../../Users/jip/AppData/Roaming/npm/node_modules/powerbi-visuals-tools/node_modules/less-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./style/visual.less 2.27 KiB [code generated]
7 modules
ERROR in ./node_modules/axios/lib/defaults.js 23:20-27
Module not found: Error: Can't resolve 'process/browser' in 'C:\Code\accoPLANNING\Visual\node_modules\axios\lib'
resolve 'process/browser' in 'C:\Code\accoPLANNING\Visual\node_modules\axios\lib'
Parsed request is a module
using description file: C:\Code\accoPLANNING\Visual\node_modules\axios\package.json (relative path: ./lib)
resolve as module
C:\Code\accoPLANNING\Visual\node_modules\axios\lib\node_modules doesn't exist or is not a directory
C:\Code\accoPLANNING\Visual\node_modules\axios\node_modules doesn't exist or is not a directory
C:\Code\accoPLANNING\Visual\node_modules\node_modules doesn't exist or is not a directory
looking for modules in C:\Code\accoPLANNING\Visual\node_modules
C:\Code\accoPLANNING\Visual\node_modules\process doesn't exist
C:\Code\accoPLANNING\node_modules doesn't exist or is not a directory
C:\Code\node_modules doesn't exist or is not a directory
C:\node_modules doesn't exist or is not a directory
aliased with mapping 'process': 'C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js' to 'C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js/browser'
using description file: C:\Code\accoPLANNING\Visual\node_modules\axios\package.json (relative path: ./lib)
using description file: C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\package.json (relative path: ./index.js/browser)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.tsx doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.ts doesn't exist
.jsx
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.jsx doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.js doesn't exist
.css
Field 'browser' doesn't contain a valid alias configuration
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.css doesn't exist
as directory
C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser doesn't exist
@ ./node_modules/axios/lib/axios.js 11:15-36
@ ./node_modules/axios/index.js 1:0-39
@ ./src/visual.ts 358:0-26 2053:23-33
@ ./.tmp/precompile/visualPlugin.ts 1:0-42 10:8-14 11:17-23
webpack 5.37.1 compiled with 1 error in 24908 ms
i 「wdm」: Failed to compile.
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir 'C:\Users\jip\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js'
Can you advice how to fix this?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 16
- Comments: 23 (5 by maintainers)
Commits related to this issue
- Update webpack config tests As #365 seems to be a fairly popular use case (including for me), I propose we add the necessary tests to the webpack config to mitigate this for developers. — committed to dm-p/PowerBI-visuals-tools by dm-p 2 years ago
- Fix VSCode build There were two issues: - One was resolved by following the steps in https://github.com/microsoft/PowerBI-visuals-tools/issues/365#issuecomment-1099716186 - The other one was caused ... — committed to sourcegraph/sourcegraph by philipp-spiess a year ago
@andrewluetgers I also ran into this issue and finally resolved it by adding this to my webpck-config override - I am using react-app-rewired
If you are using a non create-react-app set up you could just addd it to the webpack config like so:
Hope that helps you!
@lucmax94 If you install
processas a dev dependency this fixed the problem for me.Use
npm install --save-dev process.@JipAccobat , so in that case I suppose that the reason of your issue is that now we use
webpackversion 5+ inpowerbi-visuals-tools, and your project dependency lib ofwebpackis also updated, but starting from version 5 they removed polyfills for Node.js variables. So you need to modify your webpack config a little bit to make it work. Please read articles about migrating to webpack 5.But as a quick tip, just try to define
processinpluginssection of yourwebpack.config.jsThanks, that worked perfectly!!
I install this but never worked for me. I am not using webpack.
Still getting the same error as above after upgrading to v3.2.3. I am not using webpack within my project but I tried to fix the error by adding webpack and adding the code from @Demonkratiy. Still getting the same error. Had to go back to v3.1.18.
That worked, thanks!
Hi, I have a similar issue and none of the abobe works for me. Also I cant find Webpack.Config.js Here is my error could anyone help?
ERROR in visual.js Module not found: Error: Can’t resolve ‘C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js’ in ‘C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView’
resolve ‘C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js’ in ‘C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView’ using description file: C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView\package.json (relative path: .) Field ‘browser’ doesn’t contain a valid alias configuration using description file: C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView\package.json (relative path: ./.tmp/build/visual.js) no extension Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js doesn’t exist .tsx Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js.tsx doesn’t exist .ts Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js.ts doesn’t exist .jsx Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js.jsx doesn’t exist .js Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js.js doesn’t exist .css Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js.css doesn’t exist as directory C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView.tmp\build\visual.js doesn’t exist
webpack 5.74.0 compiled with 1 error in 268 ms Webpack Bundle Analyzer saved report to C:\Users\gjordan.SPOERERnet\source\repos\Forge2PowerBI\forgePowerbiView\webpack.statistics.dev.html assets by status 99 bytes [cached] 1 asset
Perfect! I wanna hug you.
@JipAccobat @lucmax94 , hi folks! Do you still have this problem on latest version of tools? If so, than please can you tell me if you are using
webpackin your projects?