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
Build hanging when using database after 3.7.0 #23334
Comments
Hi. Are you creating db instance in Here is a workaround: export default defineNuxtConfig({
hooks: {
close: () => {
// Workaround for https://github.com/nuxt/cli/issues/169
process.exit(0)
}
}
}) Let's track via nuxt/cli#169 & please ping me if above workaround didn't work. |
@pi0 Yes it works, thanks a lot for the workaround! |
This workaround has nasty side effect: |
As an alternative, you could consider using an environment variable. Azure pipeline:Create a variable group and define a variable such as - job: Build
variables:
- group: MyVariableGroup BitBucket pipeline:Export a variable within the build step of your pipeline, making it available in your code. - step:
script:
- export IS_PIPELINE=yes
- npm run build Github action:Define an environment variable for your build step, making it available in your code. steps:
- name: Build
env:
IS_PIPELINE: yes
run: npm run build You can then test for the existence of this environment variable, as a means of controlling whether you initialize a connection within your plugins. let redis = null
if(!('IS_PIPELINE' in process.env)) {
redis = new Redis(azureRedis)
} Provided that you explicitly define your environment variables with the |
Environment
I have the same issue running locally, and when building on Netlify / Vercel
Reproduction
3.7.0
to3.7.3
plugins/index.ts
nuxt build
Describe the bug
When running
nuxt build
, the build keeps hanging after:I was able to find this comes from my database connection, which works fine in
3.6.5
but blocks the build when upgrading to Nuxt from3.7.0
to3.7.3
The issue is the same if I have my database connection in
server/index.ts
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: