Skip to content

Cannot find module /dist/pure.js @stripe/connect-js #3

Description

@lucacicada

For some bizarre reasons, stripe connect cannot be resolved properly. This is a workaround to fix the issue.

// nuxt.config.ts
export default defineNuxtConfig({
  vite: {
    resolve: {
      alias: [
        {
          find: '@stripe/connect-js/pure',
          replacement: '@stripe/connect-js/dist/pure.js',
        },
      ],
    },
  }
})

Adding an alias in Vite that point @stripe/connect-js/pure to @stripe/connect-js/dist/pure.js fixes the import issue.

As a side-note, this problem do not always occurs. I got it today on a monorepo, after deleting node_modules the lock file and reinstalling it went away. Oh gosh it's easier to explain a ghost than computer bugs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions