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

ReferenceError: exports is not defined #262

Open
solanaspacesdev opened this issue Feb 8, 2025 · 2 comments
Open

ReferenceError: exports is not defined #262

solanaspacesdev opened this issue Feb 8, 2025 · 2 comments

Comments

@solanaspacesdev
Copy link

I'm trying to use this library, but as soon as I add it with npm i @streamflow/stream and I try to start my server, i'm getting an error

ReferenceError: exports is not defined
    at file:///Users/jan/Projects/store/tg-token-gating/node_modules/@streamflow/stream/dist/cjs/index.js:31:23
    at ModuleJobSync.runSync (node:internal/modules/esm/module_job:395:35)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:329:47)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1411:24)
    at Module._compile (node:internal/modules/cjs/loader:1544:5)
    at node:internal/modules/cjs/loader:1668:16
    at Object.require.extensions.<computed> [as .js] (/Users/jan/Projects/store/tg-token-gating/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1313:32)
    at Function._load (node:internal/modules/cjs/loader:1123:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
@ceeriil
Copy link

ceeriil commented Feb 10, 2025

@solanaspacesdev Can you reproduce this error? Also could you share your node version and the version of streamflow you are using. I just set up a fresh Nextjs project ,installed streamflow and imported something from it and didn't get that error.

@solanaspacesdev
Copy link
Author

Yes, I can reproduce it. Might be because of my tsconfig? This is on a nodejs backend app

{
  "compilerOptions": {
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es6",
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "./dist",
    "resolveJsonModule": true,
    "baseUrl": "./src",
    "jsx": "react",
    "strict": false
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules/**"]
}

node v22.13.1

I'll try to make a reproducible repo when I get back from vacation

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

No branches or pull requests

2 participants