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.
For some bizarre reasons, stripe connect cannot be resolved properly. This is a workaround to fix the issue.
Adding an alias in Vite that point
@stripe/connect-js/pureto@stripe/connect-js/dist/pure.jsfixes the import issue.As a side-note, this problem do not always occurs. I got it today on a monorepo, after deleting
node_modulesthe lock file and reinstalling it went away. Oh gosh it's easier to explain a ghost than computer bugs.