react-svg-spinner icon indicating copy to clipboard operation
react-svg-spinner copied to clipboard

Published package.json has incorrect umd / module paths

Open fdidron opened this issue 3 years ago • 1 comments

While migrating an app that uses this package from CRA to snowpack, I'm getting the following error:

We resolved "react-svg-spinner" to ./node_modules/react-svg-spinner/dist/foo.mjs, but the file does not exist on disk.

Looking at the package.json in my node_modules folder, it seems that the package.json has incorrect fields:

  ...
  "umd:main": "dist/foo.umd.js",
  "module": "dist/foo.mjs",
  ...

I'm guessing those are default values set by microbundle and maybe need some fixing when publishing the package on npm ?

fdidron avatar Mar 25 '21 02:03 fdidron

Oh and a workaround if anyone wants to use this nice package with snowpack, add an alias in snowpack.config.js

module.exports = {
  alias: {                                                                                                                                      
    "react-svg-spinner": "./node_modules/react-svg-spinner/dist/index.umd.js"
  }
}

fdidron avatar Mar 25 '21 02:03 fdidron