Subscribe on changes!

Snowpack create common files that are discarded by resolveWebModule

avatar
May 8th 2020

Describe the bug

Snowpack create common files in web_modules that are discarded by resolveWebModule (1), thus leading to error like this one [vite] Error while resolving node_modules with id "common/react-8a00ae8c.js":

(1): in node_modules/vite/dist/server/serverPluginModuleRewrite.js:61

console.log(webModulePath, id, webModulesMap);
/projects/map/web_modules/common/react-8a00ae8c.js.js common/react-8a00ae8c.js Map(3) {
  'react' => '/projects/map/web_modules/react.js',
  'react-dom' => '/projects/map/web_modules/react-dom.js',
  'react-simple-maps' => '/projects/map/web_modules/react-simple-maps.js'
}

Current and silly workaround is to manually remove the common file and copy paste its content in the library files that need it.

System Info

  • required vite version:"^0.12.0"
  • required Operating System: OSX
  • required Node version: 12
avatar
May 8th 2020

Should I add a reproducible sandbox of this bug ?

avatar
May 8th 2020

It's already fixed, see the commit (not released yet)