You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose we have a service in targets/services/service.js, that requires a file in targets/services/subdir/file.js, that itself requires a nodejs dependency, e.g. fs.
When trying to build the service with cozy-scripts through yarn watch, an error will throw: Module not found: Error: Can't resolve 'fs'.
This is because cozy-scripts will only consider js files in targets/services/ but not in subfolder:
Hence, any file in subdir/ requiring a nodejs primitive will fail.
A workaround would be to recursively find any .js file in targets/services/service.js, but I'm not sure this is the correct approach, as any file will be a new entry:
Suppose we have a service in
targets/services/service.js
, that requires a file intargets/services/subdir/file.js
, that itself requires a nodejs dependency, e.g.fs
.When trying to build the service with cozy-scripts through
yarn watch
, an error will throw:Module not found: Error: Can't resolve 'fs'
.This is because cozy-scripts will only consider js files in
targets/services/
but not in subfolder:create-cozy-app/packages/cozy-scripts/config/webpack.config.services.js
Lines 15 to 19 in 4b790b8
Hence, any file in
subdir/
requiring a nodejs primitive will fail.A workaround would be to recursively find any .js file in
targets/services/service.js
, but I'm not sure this is the correct approach, as any file will be a new entry:create-cozy-app/packages/cozy-scripts/config/webpack.config.services.js
Line 33 in 4b790b8
We met this issue with @JulienMirval when trying to use
cozy-konnector-libs
in a service: https://github.com/JulienMirval/dissec_cozy/blob/ee206472c49c723af630e1d740c1e0384dc73b64/src/targets/services/helpers/model.js#L2Any thoughts?
The text was updated successfully, but these errors were encountered: