Skip to content

chore(deps): upgrade vite & nuxt dependencies#760

Open
timhanlon wants to merge 1 commit into
histoire-dev:mainfrom
timhanlon:chore/upgrade-vite-node
Open

chore(deps): upgrade vite & nuxt dependencies#760
timhanlon wants to merge 1 commit into
histoire-dev:mainfrom
timhanlon:chore/upgrade-vite-node

Conversation

@timhanlon

@timhanlon timhanlon commented Sep 7, 2024

Copy link
Copy Markdown

Description

We're currently migrating a monorepo from nx to pnpm workspaces, and histoire dev is failing with:

Error while collecting story [foo].story.vue:
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '[foo]' is not supported resolving ES modules imported from [foo]

ERR_UNSUPPORTED_DIR_IMPORT issues are mentioned in #712 and #696 with workarounds of either pinning mlly to 1.4.2, or using viteNodeInlineDeps for problematic packages.

This PR bumps vite, vite-node, and nuxt packages, and adds a small fix to isCollecting as tsc was failing on PluginContextMeta.

Tests are passing, build is building, and histoire dev is running successfully.

Edit: looks like previews are failing with a node and pnpm version mismatch in the root package.json, assume the answer is bumping the node version in engines, but will hold off on that.

Just in case this helps anyone, this is working in the meantime:

  "pnpm": {
    "overrides": {
      "histoire>vite-node": "2.0.5",
      "histoire>vite": "5.4.3",
      "histoire>vitest": "2.0.5",
      "@histoire/plugin-nuxt>nuxt": "^3.12.4",
      "@histoire/plugin-nuxt>vite": "5.4.3",
      "@histoire/plugin-nuxt>@nuxt/kit": "^3.12.4",
      "@histoire/plugin-nuxt>@nuxt/schema": "^3.12.4",
      "@histoire/plugin-vue>vite": "5.4.3"
    }
  }

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@codesandbox

codesandbox Bot commented Sep 7, 2024

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify

netlify Bot commented Sep 7, 2024

Copy link
Copy Markdown

Deploy Preview for histoire-examples-vue3 failed.

Name Link
🔨 Latest commit 3a44baf
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/66dcaa0adc412d0008a295bf

@netlify

netlify Bot commented Sep 7, 2024

Copy link
Copy Markdown

Deploy Preview for histoire-controls failed.

Name Link
🔨 Latest commit 3a44baf
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/66dcaa0a37a5e10008172ca7

@netlify

netlify Bot commented Sep 7, 2024

Copy link
Copy Markdown

Deploy Preview for histoire-examples-svelte3 failed.

Name Link
🔨 Latest commit 3a44baf
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/66dcaa0af5f8e600080e5f85

@netlify

netlify Bot commented Sep 7, 2024

Copy link
Copy Markdown

Deploy Preview for histoire-site failed.

Name Link
🔨 Latest commit 3a44baf
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/66dcaa0a14dbfc00080056c1

@rubenhazelaar

rubenhazelaar commented Sep 10, 2024

Copy link
Copy Markdown

When I apply the overrides I get another, but different error (see below)

Error while collecting story /src/components/button/Base.story.vue:
TypeError [ERR_PACKAGE_IMPORT_NOT_DEFINED]: Package import specifier "#build/nuxt.config.mjs" is not defined in package /src/node_modules/nuxt/package.json imported from /src/node_modules/nuxt/dist/app/nuxt.js
    at importNotDefined (node:internal/modules/esm/resolve:291:10)
    at packageImportsResolve (node:internal/modules/esm/resolve:741:9)
    at moduleResolve (node:internal/modules/esm/resolve:917:16)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:540:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:509:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
    at link (node:internal/modules/esm/module_job:95:36)

I use npm so the below the overrides in npm style (did bump the nuxt verion, however error occurs also in version you mention):

    "overrides": {
        "histoire": {
            "vite-node": "2.0.5",
            "vite": "5.4.3",
            "vitest": "2.0.5"
        },
        "@histoire/plugin-nuxt": {
            "nuxt": "^3.13.1",
            "vite": "5.4.3",
            "@nuxt/kit": "^3.13.1",
            "@nuxt/schema": "^3.13.1"
        },
        "@histoire/plugin-vue": {
            "vite": "5.4.3"
        }
    }

@BBoehm

BBoehm commented Oct 25, 2024

Copy link
Copy Markdown

Checks seem to be failing due to node version missmatch.
Vite 5 requires node 18 or 20+: https://vite.dev/guide/migration#node-js-support

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 this pull request may close these issues.

3 participants