Skip to content

REPL zip with external import omits sirv-cli dependency #3795

@trbrc

Description

@trbrc

Describe the bug
If you download a REPL with an external dependency, that dependency is conveniently added to the project. Unfortunately, the required dependency sirv-cli is also overwritten, causing npm run dev to fail.

Logs

$ npm run dev

> [email protected] dev /svelte-app-1
> rollup -c -w

rollup v1.25.2
bundles src/main.js → public/bundle.js...
LiveReload enabled
created public/bundle.js in 349ms

[2019-10-26 00:00:00] waiting for changes...

> [email protected] start:dev /svelte-app-1
> sirv public --single --dev

sh: sirv: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start:dev: `sirv public --single --dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

To Reproduce

  1. Go to https://svelte.dev/repl/
  2. Add a line like import 'leftpad'; to the default <script> tag
  3. Click the icon for "download zip file"

Expected behavior
Dependencies in package.json in the downloaded zip should look like this:

"dependencies": {
  "sirv-cli": "^0.4.4",
  "leftpad": "latest"
}

but actually looks like this:

"dependencies": {
  "leftpad": "latest"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions