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

npm run pack:web failes with Module not found #1238

Closed
mia-san opened this issue Jan 9, 2022 · 3 comments · Fixed by #1240
Closed

npm run pack:web failes with Module not found #1238

mia-san opened this issue Jan 9, 2022 · 3 comments · Fixed by #1240

Comments

@mia-san
Copy link
Contributor

mia-san commented Jan 9, 2022

thank you for nice template.

we're evaluating your template and found that npm run pack:web fails.

$ npm run pack:web
...
Module not found: Error: Can't resolve 'os' in './vue-electron/src/renderer/components'
Module not found: Error: Can't resolve 'fs' in './vue-electron/node_modules/electron'
Module not found: Error: Can't resolve 'path' in './vue-electron/node_modules/electron'

it seems that webpack.web.config has 2 'resolve' setting:

resolve: {
fallback: {
// fs: false,
// os: require.resolve('os-browserify/browser'),
// path: require.resolve('path-browserify'),
fs: false,
os: false,
path: false,
},
},

resolve: {
alias: {
'@': path.join(__dirname, '../src/renderer'),
vue$: 'vue/dist/vue.esm.js',
src: path.join(__dirname, '../src/'),
icons: path.join(__dirname, '../_icons/'),
},
extensions: ['.ts', '.js', '.vue', '.json', '.css'],
},

and latter disables former fallback setting.

merging these 2 setting seems to solve the compile error.

thank you.
//

@mubaidr
Copy link
Owner

mubaidr commented Jun 15, 2022

This seems to be a bug. Do you mind creating pull request to fix config?

@mia-san
Copy link
Contributor Author

mia-san commented Jun 16, 2022

sure, please give me some time.

@mia-san
Copy link
Contributor Author

mia-san commented Jun 16, 2022

I have created pull-request #1240.
hope this is good.

mubaidr added a commit that referenced this issue Jun 17, 2022
coalesce 2 resolve objects
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

Successfully merging a pull request may close this issue.

2 participants