Skip to content

Snowpack can't find node_modules/optimal-select/src/index.js #70

@ziodave

Description

@ziodave

Hello,

I am using Snowpack, my package.json looks something like this:

{
  "name": "app",
  "version": "0.0.1",
  "description": "",
  "main": "src/index.js",
  "scripts": {
    "start": "snowpack dev",
    "build": "snowpack build",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "esbuild": "^0.12.5",
    "snowpack": "^3.5.2",
    "tslib": "^2.2.0",
    "typescript": "^4.3.2"
  },
  "dependencies": {
    "optimal-select": "^4.0.1"
  }
}

When I try to npm start I get the following error:

[snowpack] We resolved "optimal-select" to ./node_modules/optimal-select/src/index.js, but the file does not exist on disk.

In node_modules/optimal-select I can't find the src folder:

image

By looking into the package.json file I can see the following declaration:

…
"module": "src/index.js",
…

If I change it to

…
"module": "lib/index.js",
…

it works.

Is it the right thing to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions