[rollup] Unresolved dependencies
[rollup] Unresolved dependencies
I had an weired warning message when building my app.
TXT(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
spark-md5 (imported by src/components/Cloudinary.svelte)
...
...
(!) Missing global variable name
Use output.globals to specify browser global variable names
corresponding to external modules
spark-md5 (guessing 'md5')
- No problem had occurred before.
- No problem in local environment.
- Dependency error in production server
Cloudinary.svelte import axios from 'axios'
import api from '../service/api'
import md5 from 'spark-md5' // !!!! <+=== here
Cause
I added Spark Md5
dependency in local pc.
BASH$ npm install --save spark-md5
But, I fogot to install the library in production server
BASHroot@pc-toybox:/workspace/docker/backend/blog-fe/node_modules# ls
... ... ... ... sourcemap-codec ...
... ... ... string-width ...
- no
spark-md5
in node_modules
Solution
just installed the library in production server
BASH$ npm install --save spark-md5
- done
