#trollboy

1 messages · Page 1 of 1 (latest)

unkempt bearBOT
tepid hawk
#

hello! i'm not familiar at all with sveltejs, but what updates did you make?

ocean crypt
#

upgraded stripe-svelte

#

import Stripe from 'stripe'
when uncommented gives me:

ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/home/node/app/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
    at file:///home/node/app/public/server/chunks/_server-5d526f44.js:2181:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:528:24)
    at async resolve (file:///home/node/app/public/server/chunks/index-19e3e44c.js:2976:52)
    at async Object.handle (file:///home/node/app/public/server/chunks/hooks.server-8b9da1b3.js:8:20)
    at async respond (file:///home/node/app/public/server/chunks/index-19e3e44c.js:3016:22)
    at async Array.ssr (file:///home/node/app/public/handler.js:16060:3)
tepid hawk
#

i'm afraid stripe-svelte is developed and maintained by a third party, and not by Stripe. I'd suggest reaching out to the maintainers of that repo for help.

ocean crypt
#

'stripe' is the official supported library though

#

but thank you

ocean crypt
#

when I updated stripe-svelte, it updated all the dev dependencies. including the official stripe npm package is causing the error

ocean crypt
tepid hawk
#

what it sounds like to me is that it's conflicting with something in your stripe-svelte package. if you can give me a simple project that replicates the issue without using stripe-svelte, I'll be able to look into this further. I'm currently not able to reproduce it unfortunately.