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

Error: Can't resolve 'process/browser' #365

Closed
JipAccobat opened this issue May 20, 2021 · 23 comments
Closed

Error: Can't resolve 'process/browser' #365

JipAccobat opened this issue May 20, 2021 · 23 comments

Comments

@JipAccobat
Copy link

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?

@lucmax94
Copy link

Getting a similiar error when using version 3.1.19, with 3.1.18 everything works fine:

ERROR in ./node_modules/async-validator/dist-web/index.js 119:11-18
Module not found: Error: Can't resolve 'process/browser' in 'C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\dist-web'
resolve 'process/browser' in 'C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\dist-web'
  Parsed request is a module
  using description file: C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\package.json (relative path: ./dist-web)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\dist-web\node_modules doesn't exist or is not a directory
      C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\node_modules doesn't exist or is not a directory
      C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\node_modules doesn't exist or is not a directory
      looking for modules in C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules
        C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\process doesn't exist
      C:\Users\sacul\Desktop\Arbeit\Power BI\node_modules doesn't exist or is not a directory
      C:\Users\sacul\Desktop\Arbeit\node_modules doesn't exist or is not a directory
      C:\Users\sacul\Desktop\node_modules doesn't exist or is not a directory
      C:\Users\sacul\node_modules doesn't exist or is not a directory
      C:\Users\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\sacul\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js' to 'C:\Users\sacul\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js/browser'
      using description file: C:\Users\sacul\Desktop\Arbeit\Power BI\pbi_process_analyzer\node_modules\async-validator\package.json (relative path: ./dist-web)
        Field 'browser' doesn't contain a valid alias configuration
        using description file: C:\Users\sacul\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\sacul\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\sacul\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\sacul\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\sacul\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\sacul\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\sacul\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser.css doesn't exist
          as directory
            C:\Users\sacul\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\process\index.js\browser doesn't exist
 @ ./node_modules/rc-field-form/es/utils/validateUtil.js 7:0-48 13:21-38
 @ ./node_modules/rc-field-form/es/Field.js 16:0-53 269:22-35
 @ ./node_modules/rc-field-form/es/index.js 2:0-28 10:16-21 13:0-46
 @ ./node_modules/antd/es/config-provider/index.js 4:0-63 127:49-63
 @ ./node_modules/antd/es/index.js 18:0-62 18:0-62
 @ ./src/App.tsx 37:0-41 51:11-26 52:16-36 1011:160-165
 @ ./src/visual.ts 291:0-41 365:41-44 390:4-18 474:18-33 497:20-34 515:16-31 522:30-53 532:16-30 543:16-30 1081:22-50 1087:24-56 1093:22-52 1097:22-47 1104:24-54 1112:24-55 1118:22-56 1122:22-54
 @ ./.tmp/precompile/visualPlugin.ts 1:0-42 10:8-14 11:17-23

webpack 5.38.1 compiled with 1 error in 65053 ms
i 「wdm」: Failed to compile.

@uve
Copy link
Contributor

uve commented Jun 4, 2021

try to update powerbi-visuals-tools to v3.2.1+

@Demonkratiy
Copy link
Contributor

@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 webpack in your projects?

@JipAccobat
Copy link
Author

@Demonkratiy I'm still facing the issue in version 3.2.3.
Yes I do have webpack installed in my project.

@Demonkratiy
Copy link
Contributor

@JipAccobat , so in that case I suppose that the reason of your issue is that now we use webpack version 5+ in powerbi-visuals-tools, and your project dependency lib of webpack is 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 process in plugins section of your webpack.config.js

const webpack = require("webpack");
...
module.exports = {
...,
    plugins: [
        new webpack.ProvidePlugin({
            process: "process/browser"
        }), ...
    ]
};

@JipAccobat
Copy link
Author

JipAccobat commented Jun 8, 2021

Hello @Demonkratiy
I'm not really using webpack, so I removed it still the same error.
I also tried making a now visual and then only installing axios and same error when complying.
I now also have an other dependency that cannot resolve jquery.

(node:10988) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:10988) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
(node:10988) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
Webpack Bundle Analyzer saved report to C:\Code\accoPLANNING\Visual\webpack.statistics.dev.html


 ERROR  Failed to compile with 2 errors                                                                                                                                                                                                                                                                             13:26:41

 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'

 error  in ./node_modules/flexmonster/flexmonster.full.js

Module not found: Error: Can't resolve 'jquery' in 'C:\Code\accoPLANNING\Visual\node_modules\flexmonster'

× 「wdm」: assets by status 4.62 MiB [cached] 8 assets
Entrypoint visual.js = visual.css visual.js 2 auxiliary assets
orphan modules 46.6 KiB [orphan] 32 modules
runtime modules 1.25 KiB 6 modules
modules by path ./node_modules/core-js/ 426 KiB 444 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 ./src/*.ts 193 KiB 4 modules
modules by path ./node_modules/powerbi-visuals-utils-dataviewutils/lib/*.js 5.53 KiB 3 modules
modules by path ./node_modules/uuid/dist/esm-browser/*.js 274 bytes 2 modules
css modules 275 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 3.09 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 360:0-26 2019:23-33
 @ ./.tmp/precompile/visualPlugin.ts 1:0-42 10:8-14 11:17-23

ERROR in ./node_modules/flexmonster/flexmonster.full.js 10:1481828-1481834
Module not found: Error: Can't resolve 'jquery' in 'C:\Code\accoPLANNING\Visual\node_modules\flexmonster'
resolve 'jquery' in 'C:\Code\accoPLANNING\Visual\node_modules\flexmonster'
  Parsed request is a module
  using description file: C:\Code\accoPLANNING\Visual\node_modules\flexmonster\package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      C:\Code\accoPLANNING\Visual\node_modules\flexmonster\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
        single file module
          using description file: C:\Code\accoPLANNING\Visual\package.json (relative path: ./node_modules/jquery)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery doesn't exist
            .tsx
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery.tsx doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery.ts doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery.jsx doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery.js doesn't exist
            .css
              Field 'browser' doesn't contain a valid alias configuration
              C:\Code\accoPLANNING\Visual\node_modules\jquery.css doesn't exist
        C:\Code\accoPLANNING\Visual\node_modules\jquery 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
 @ ./src/accoPLANNING.ts 74:0-38 109:21-32
 @ ./src/visual.ts 357:0-42 583:33-45
 @ ./.tmp/precompile/visualPlugin.ts 1:0-42 10:8-14 11:17-23

webpack 5.38.1 compiled with 2 errors in 18999 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'

@lucmax94
Copy link

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.

const webpack = require("webpack");
...
module.exports = {
...,
    plugins: [
        new webpack.ProvidePlugin({
            process: "process/browser"
        }), ...
    ]
};

@Demonkratiy
Copy link
Contributor

@lucmax94, @JipAccobat, ok, thanks for the info. Is it possible that someone of you will give me an access to your project, so I can debug it? If this is not possible, that's ok, but it can make solving this issue easier and faster.

@uve uve closed this as completed Jun 21, 2021
@JipAccobat
Copy link
Author

@lucmax94 If you install process as a dev dependency this fixed the problem for me.

Use npm install --save-dev process.

@lucmax94
Copy link

@lucmax94 If you install process as a dev dependency this fixed the problem for me.

Use npm install --save-dev process.

That worked, thanks!

@LingVuDev
Copy link

@lucmax94 If you install process as a dev dependency this fixed the problem for me.

Use npm install --save-dev process.

Thanks, great. Saved my day.

@mainul-islam-faruqi
Copy link

mainul-islam-faruqi commented Mar 30, 2022

@lucmax94 If you install process as a dev dependency this fixed the problem for me.

Use npm install --save-dev process.

I install this but never worked for me.
I am not using webpack.
image

@andrewluetgers
Copy link

andrewluetgers commented Apr 11, 2022

I install this but never worked for me.

Same error message here, I am using webpack and babel

@sstef
Copy link

sstef commented Apr 14, 2022

@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

config.module.rules.push({
      test: /\.m?js/,
      resolve: {
          fullySpecified: false
      }
  })

If you are using a non create-react-app set up you could just addd it to the webpack config like so:

module: {
    rules: [
       {
          test: /\.m?js/,
          resolve: {
              fullySpecified: false
          }
    ]
}

Hope that helps you!

@JulienRioux
Copy link

@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

config.module.rules.push({
      test: /\.m?js/,
      resolve: {
          fullySpecified: false
      }
  })

If you are using a non create-react-app set up you could just addd it to the webpack config like so:

module: {
    rules: [
       {
          test: /\.m?js/,
          resolve: {
              fullySpecified: false
          }
    ]
}

Hope that helps you!

Thanks, that worked perfectly!!

@SaulBurgos
Copy link

@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

config.module.rules.push({
      test: /\.m?js/,
      resolve: {
          fullySpecified: false
      }
  })

If you are using a non create-react-app set up you could just addd it to the webpack config like so:

module: {
    rules: [
       {
          test: /\.m?js/,
          resolve: {
              fullySpecified: false
          }
    ]
}

Hope that helps you!

Save my day

@mavsin
Copy link

mavsin commented May 24, 2022

@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

config.module.rules.push({
      test: /\.m?js/,
      resolve: {
          fullySpecified: false
      }
  })

If you are using a non create-react-app set up you could just addd it to the webpack config like so:

module: {
    rules: [
       {
          test: /\.m?js/,
          resolve: {
              fullySpecified: false
          }
    ]
}

Hope that helps you!

Perfect! I wanna hug you.

dm-p added a commit to dm-p/PowerBI-visuals-tools that referenced this issue May 26, 2022
As microsoft#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.
@AbdulrasheedAdediran
Copy link

worked like magic!

Thanks

@izhansari
Copy link

@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

config.module.rules.push({
      test: /\.m?js/,
      resolve: {
          fullySpecified: false
      }
  })

If you are using a non create-react-app set up you could just addd it to the webpack config like so:

module: {
    rules: [
       {
          test: /\.m?js/,
          resolve: {
              fullySpecified: false
          }
    ]
}

Hope that helps you!

THis worked for me! Thanks a million!!

@gjordanp
Copy link

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

philipp-spiess added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this issue Mar 2, 2023
There were two issues:

- One was resolved by following the steps in microsoft/PowerBI-visuals-tools#365 (comment)
- The other one was caused by the .ttf icon in monaco being moved, I changed the rule to now bundle any ttf with the full name (we only have one anyways).
@juanmiguel431
Copy link

I'm curious. What is the difference having the process package installed in devDependencies section instead of just dependencies ?

@AnderSouza
Copy link

It worked for me as well. Thank you!

@AleksSavelev
Copy link
Contributor

Hello everyone!
Is it still a problem for someone?
If so, we can merge the old PR

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