I'm building a project using Vue 3 and nodejs. I need to include some configurations that should change depending on where I run the code. I found the config package that seems very promising, but I started to get a huge number of errors during the start of the project.
The first issue regards some missing packages.
Module not found: Error: Can't resolve 'util' ...Module not found: Error: Can't resolve 'path' ...Module not found: Error: Can't resolve 'fs' ...Module not found: Error: Can't resolve 'os' ...
I solved them by adding this code in the config file:
resolve: { fallback: { fs: false, os: false, util: false, path: false }}
Now the project starts, but I get these warnings:
warning in ./node_modules/config/lib/config.jsCritical dependency: the request of a dependency is an expression warning in ./node_modules/config/parser.jsrequire.extensions is not supported by webpack. Use a loader instead.
When I surf to localhost:8080
I get:
Uncaught ReferenceError: process is not defined
Instead of using resolve.fallback
, I also tried to install the dependencies:
npm install path fs os util
but I continue to get the error for fs:
Module not found: Error: Can't resolve 'fs' ...
Is there a way to use the config package easily along with Vue 3?