Skip to content
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

Cannot find module moment #79

Open
IgnisDa opened this issue May 8, 2021 · 1 comment
Open

Cannot find module moment #79

IgnisDa opened this issue May 8, 2021 · 1 comment

Comments

@IgnisDa
Copy link

IgnisDa commented May 8, 2021

I encountered this problem while deploying my nuxt app to Heroku. My app has a dependency on this module. I have target: 'server' set in my nuxt.config.js.

The solution was pretty simple. The installation instructions say that you have to install this dependency as a development one. But that works only for nuxt apps that have target: 'static' set in their nuxt.config.js.

I feel this should be mentioned in the installation instructions for the module

@IgnisDa IgnisDa mentioned this issue May 8, 2021
@Chrisimir
Copy link

I experienced this same issue. It seems to be due to automatic pruning of devDependencies in the buildpack.

From Heroku troubleshooting:

In order create a smaller slug size for apps, the buildpack will prune out the devDependencies from the package.json at the end of the build, so that the slug will only include the dependencies that are listed at runtime. If there is a dependency that is in the devDependencies that is needed after the prune occurs, move the dependency to dependencies, so it is not removed.

So to fix it you can either move the devDependencies to dependencies or turn off pruning of devDependencies with NPM: heroku config:set NPM_CONFIG_PRODUCTION=false YARN: heroku config:set YARN_PRODUCTION=false

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

Successfully merging a pull request may close this issue.

2 participants