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

Nuxt 3.9.0 Internal server error: Soft-invalidated module "entry.js" should not have existing transform result #3472

Closed
4 tasks done
serkodev opened this issue Dec 29, 2023 · 31 comments
Assignees
Labels
bug Something isn't working nuxt

Comments

@serkodev
Copy link
Contributor

serkodev commented Dec 29, 2023

UnoCSS version

0.58.2

Describe the bug

After running nuxt dev server, go to browser and refresh the page once, the error will show up.

Internal server error: Soft-invalidated module "/node_modules/nuxt/dist/app/entry.js" should not have existing transform result

Reproduction

  1. create a new nuxt project
  2. add @unocss/nuxt module
  3. run nuxt dev
  4. go to browser, no error on first load
  5. (Require this step) refresh the page once and the error shows up

https://stackblitz.com/edit/github-xtxzaj?file=package.json

Additional info

Already try to add the following config regarding to #3468 (comment) but still having error

export default defineConfig({
  features: {
    inlineStyles: false,
  },
})

System Info

"nuxt": "^3.9.0",
"vue": "^3.4.0",
"vue-router": "^4.2.5"

Validations

@zyyv zyyv self-assigned this Dec 30, 2023
@zyyv zyyv added bug Something isn't working nuxt labels Dec 30, 2023
Aterbonus added a commit to Aterbonus/nuxt-template that referenced this issue Jan 1, 2024
… critters

unocss/unocss#3472
when the issue is solve we must remove the inlineStyles: false on nuxt.config.ts
@serkodev
Copy link
Contributor Author

serkodev commented Jan 5, 2024

update: after testing with the latest unocss (0.58.3), this issue is still not solved

@kissu
Copy link

kissu commented Jan 8, 2024

I do indeed have the same issue but it kinda disappears after a few refreshes? Not really consistent but not a huge blocker either. 🤔

@cloydlau
Copy link

cloydlau commented Jan 9, 2024

+1, I have temporarily downgraded nuxt to version 3.8.2.

@gigantino
Copy link

+1, having the same issue.

@jandobrx
Copy link

Also having this issue

I do indeed have the same issue but it kinda disappears after a few refreshes? Not really consistent but not a huge blocker either. 🤔

But this does seem to do the trick as-well no issues with my build and deployments! But big red internal server error sends gives me chills 🙃

@kissu
Copy link

kissu commented Jan 17, 2024

Working with Netlify Edge functions locally is not always perfect (works fine on an M3 chip but less on a Linux machine for some reason) but still achievable, just need to guess that the server crashes before the functions are called and restart Netlify CLI.

@kstraszewski
Copy link

After upgrading to Nuxt 3.9.3 everything is working fine for me.

@ironytr
Copy link

ironytr commented Jan 21, 2024

unocss 5.8.3
nuxt 3.9.3
vue 3.3.13
vue-router latest
Internal server error: Soft-invalidated module "/node_modules/.pnpm/nuxt@3.9.3_eslint@8.56.0_rollup@4.9.5_sass@1.70.0_typescript@5.3.3_vite@5.0.12/node_modules/nuxt/dist/app/entry.js" should not have existing transform result

@dellumdeus
Copy link

Any news on this?

@AndrewBogdanovTSS
Copy link
Contributor

unocss 5.8.3
@unocss/nuxt 0.58.3
nuxt 3.9.3
vue 3.4.15
image

@owl1n
Copy link

owl1n commented Jan 25, 2024

@antfu any updates?

The error is sometimes so intrusive that it is impossible to work. Sometimes, 1-2 page refreshes helps, but sometimes 40 refreshes still with error

@gigantino
Copy link

gigantino commented Jan 25, 2024

Putting this in my Nuxt config worked in my scenario:

export default defineConfig({
  features: {
    inlineStyles: false,
  },
})

Original answer

@daniandl
Copy link

TL;DR put this in your Nuxt config:

export default defineConfig({
  features: {
    inlineStyles: false,
  },
})

Original answer

The error still appears despite this

@gigantino
Copy link

gigantino commented Jan 25, 2024

The error still appears despite this

Welp, somehow it did fix it in my specific scenario. I'm using the latest version of Nuxt if that helps.

@antfu
Copy link
Member

antfu commented Jan 25, 2024

I can't reproduce with @serkodev's reproduction with the latest versions anymore. Can anyone provide another minimal reproductions?

@rylanharper
Copy link

rylanharper commented Jan 25, 2024

Hmm I am still seeing the bug in the latest release, version ^0.58.4. The issue arises during the initial startup but is resolved upon refreshing the page.. Although its hard to replicate, after that first initial issue, I can't seem to get it to reappear when I start/stop the dev sever again.

Actually I have to wait about 30sec to a min after stopping/starting the dev sever for it to reappear. Here is a screenshot from just right now:
Screenshot 2024-01-25 at 10 40 31 AM

Hmm could this have anything to do with using @unocss/transformer-directives within a sass scoped context? I have some styling on my Nuxt components like this:

<style lang="scss" scoped>
form {
  @apply flex flex-col my-6;

  .container {
    @apply relative w-full;

    input {
      @apply w-full py-2 px-3.5 mb-2.5;
      @apply normal-case border border-zinc-300 rounded-md appearance-none;
    }
  }
}
</style>

@naknakLEE
Copy link

+1, having the same issue.

@antfu
Copy link
Member

antfu commented Jan 26, 2024

Again, I would need a minimal reproduction to investigate this - saying +1 does not improve the situation, for the record. Thanks

@re-ovo
Copy link
Contributor

re-ovo commented Jan 26, 2024

Under my test, I need to open F12, disable network cache, it only seems to appear on the second load, if the cache is not disabled, then it will not load the second time

For replication code, just nuxt+unocss

After some testing, it seems to be caused by import 'uno.css', whether it is imported automatically or manually.

@hunghg255
Copy link

hunghg255 commented Jan 26, 2024

I'm not coding nuxt, but I tried debug error after I read on Twitter =)))
I recorded an error in this link, everybody can check: https://streamable.com/hvrvnw

Step:
1: npm run dev open localhost at the first browser
2: turn off npm run dev
3: remove .nuxt and node_modules/.cache
4: open 2nd browser
5: npm run dev and open localhost at 2nd browser
=> The error will appear on the first browser

@kissu
Copy link

kissu commented Jan 26, 2024

I'm not coding nuxt, but I tried debug error after I read on Twitter =))) I recorded an error in this link, everybody can check: https://streamable.com/hvrvnw

Step: 1: npm run dev open localhost at the first browser 2: turn off npm run dev 3: remove .nuxt and node_modules/.cache 4: open 2nd browser 5: npm run dev => The error will appear on the first browser

Do you please have the link for your code? A video record is not considered a valid reproduction unfortunately. 😅

@hunghg255
Copy link

hunghg255 commented Jan 26, 2024

link

I downloaded code from stackblitz. link above

@huangyan321
Copy link

https://stackblitz.com/edit/github-dqvhqs?file=package.json
This link provides the minimal reproduction. To reproduce the warning, please follow these steps:

  1. Wait for the Nuxt build to complete.
  2. Once the page has finished loading, click refresh once.

@deglier
Copy link

deglier commented Jan 28, 2024

I have the same issue:

nuxt: 3.9.3
vue: 3.4.14
vue-router: 4.2.5
@unocs/nuxt: 0.58.3

uno presets:

[
  presetUno(),
  presetForms(),
  presetHeadlessUi(),
  presetIcons(),
  presetAttributify(),
  presetScrollbar(),
  presetWebFonts({
    provider: 'google',
    fonts: {
      sans: {
        name: 'Roboto',
        weights: [400, 500, 700],
      },
    },
  }),
]

When I start the local server with the script: nuxt dev and open it in the browser, the error does not occur. But when I refresh the page, the error appears and then disappears.

When I reinstall everything, including cleaning the pnpm lock file, the server becomes stable and error-free until I restart the PC.

image

@owl1n
Copy link

owl1n commented Jan 28, 2024

Again, I would need a minimal reproduction to investigate this - saying +1 does not improve the situation, for the record. Thanks

You can use any one reproduction from above and test it like just refresh the page in browser. I think its not working on stackblitz or any sandboxes, you need start it on local environment

@NMTuan
Copy link

NMTuan commented Jan 29, 2024

I can't reproduce with @serkodev's reproduction with the latest versions anymore. Can anyone provide another minimal reproductions?
try it? https://github.com/NMTuan/nuxt_393_error

@kissu
Copy link

kissu commented Jan 29, 2024

Maybe it is also depending on the OS of the user. In my case Linux (Ubuntu) works worse than MacOS hence it's a bit tricky to reproduce properly on MacOS.

@serkodev
Copy link
Contributor Author

serkodev commented Jan 31, 2024

Already update the reproduction link with the latest UnoCSS version 0.58.4 and the error still shows up.
https://stackblitz.com/edit/github-xtxzaj?file=package.json

"@unocss/nuxt": "^0.58.4",
"nuxt": "^3.9.0",
"vue": "^3.4.0",
"vue-router": "^4.2.5"

Steps

  1. go to browser and wait for loading complete, there's no error on first load
  2. (Require this step) refresh the page once and the error shows up
reproduction.mov

@antfu
Copy link
Member

antfu commented Jan 31, 2024

It's probably introduced in vitejs/vite#14654, not yet sure how to fix it, investigating

@antfu
Copy link
Member

antfu commented Jan 31, 2024

Alright, hopefully vitejs/vite#15768 should fix this

@serkodev
Copy link
Contributor Author

Just tested and this issue should be fixed since vite v5.1.0 (nuxt v3.10.2).
Related commits: vitejs/vite#15768, vitejs/vite#15785

Thank you @antfu, @bluwy 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nuxt
Projects
None yet
Development

Successfully merging a pull request may close this issue.