Skip to content

I have to change my dependencies because of the production environment. #5222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JeHwanYoo opened this issue Jun 18, 2022 · 2 comments
Closed

Comments

@JeHwanYoo
Copy link

Describe the bug

I deployed my service to Heroku using the Svelte kit. (adapter-node)

But I ran into the following problem.

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'tslib' imported from /app/server/entries/pages/index.svelte.js

The cause of this problem is that Heroku does not install devDependencies by default.

The index.svelte.js file created by the adapter depends on the external package 'tslib'.

import { __extends, __assign, __values } from "tslib";

So, I moved tslib to dependencies, but I'm not sure if this is the right way.

According to the Heroku documentation, there seems to be an option to use devDependencies. However, in this case, the app seems to be heavy because it installs all the dependencies.

What is the most correct solution?

Reproduction

svelte.config.js

import adapter from '@sveltejs/adapter-node'
import preprocess from 'svelte-preprocess'

/** @type {import('@sveltejs/kit').Config} */
const config = {
    // Consult https://github.com/sveltejs/svelte-preprocess
    // for more information about preprocessors
    preprocess: preprocess(),

    kit: {
        adapter: adapter(),
    },
}

export default config

Logs

No response

System Info

System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
    Memory: 649.13 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.12.2 - /usr/local/bin/npm
  Browsers:
    Chrome: 102.0.5005.115
    Safari: 15.5
  npmPackages:
    @sveltejs/adapter-node: ^1.0.0-next.78 => 1.0.0-next.78 
    @sveltejs/kit: next => 1.0.0-next.350 
    svelte: ^3.44.0 => 3.48.0 


### Severity

annoyance

### Additional Information

_No response_
@Conduitry
Copy link
Member

See #3176.

@dummdidumm
Copy link
Member

Maybe for this specific instance we should move tslib into dependencies in create-svelte?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants