@poveste/plugin-nuxt 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,10 @@
1
1
  import { createApp } from 'h3';
2
2
  import { createFetch } from 'ofetch';
3
+ // Per pass: collection drops its module graph between passes, so this module and
4
+ // Nuxt's are evaluated again. `unctx`, which holds Nuxt's current app, is external
5
+ // and is not, so the previous pass's app was still current when the new one was set,
6
+ // and Nuxt threw "Context conflict" in every worker on every re-collection (#1283).
7
+ let clearedPreviousApp = false;
3
8
  export async function setupNuxtApp(publicConfig) {
4
9
  const win = window;
5
10
  win.__NUXT__ = {
@@ -37,6 +42,12 @@ export async function setupNuxtApp(publicConfig) {
37
42
  win.$fetch = createFetch({ fetch: win.fetch, Headers: win.Headers });
38
43
  win.__registry = registry;
39
44
  win.__app = h3App;
45
+ if (__HST_COLLECT__ && !clearedPreviousApp) {
46
+ clearedPreviousApp = true;
47
+ // @ts-expect-error no types
48
+ const { getNuxtAppCtx } = await import('#app/nuxt');
49
+ getNuxtAppCtx().unset();
50
+ }
40
51
  // @ts-expect-error no types
41
52
  const result = await import('#app/entry');
42
53
  await result.default();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poveste/plugin-nuxt",
3
3
  "type": "module",
4
- "version": "0.19.0",
4
+ "version": "0.20.0",
5
5
  "description": "Poveste plugin to integrate with Nuxt 4",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan",
@@ -49,23 +49,23 @@
49
49
  "node": ">=22.22.2"
50
50
  },
51
51
  "peerDependencies": {
52
- "@poveste/plugin-vue": "^0.19.0",
52
+ "@poveste/plugin-vue": "^0.20.0",
53
53
  "nuxt": "^4.5.0",
54
- "poveste": "^0.19.0"
54
+ "poveste": "^0.20.0"
55
55
  },
56
56
  "dependencies": {
57
- "@nuxt/kit": "^4.5.2",
57
+ "@nuxt/kit": "^4.6.1",
58
58
  "@rollup/plugin-replace": "^6.0.1",
59
59
  "h3": "^1.13.0",
60
60
  "ofetch": "^1.4.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@nuxt/schema": "^4.5.2",
64
- "@types/node": "^26.6.3",
65
- "poveste": "0.19.0",
63
+ "@nuxt/schema": "^4.6.1",
64
+ "@types/node": "^26.6.5",
65
+ "poveste": "0.20.0",
66
66
  "typescript": "6.0.3",
67
- "vite": "^8.3.1",
68
- "vitest": "^5.0.2"
67
+ "vite": "^8.3.4",
68
+ "vitest": "^5.0.4"
69
69
  },
70
70
  "scripts": {
71
71
  "build": "rimraf dist && tsc -d",