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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timhanlon
Copy link

@timhanlon timhanlon commented Sep 7, 2024

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

Copy link

codesandbox bot commented Sep 7, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

stackblitz bot commented Sep 7, 2024

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

Copy link

netlify bot commented Sep 7, 2024

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

Copy link

netlify bot commented Sep 7, 2024

Deploy Preview for histoire-controls failed.

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

Copy link

netlify bot commented Sep 7, 2024

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

Copy link

netlify bot commented Sep 7, 2024

Deploy Preview for histoire-site failed.

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

@rubenhazelaar
Copy link

rubenhazelaar commented Sep 10, 2024

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
Copy link

BBoehm commented Oct 25, 2024

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