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

No "export" main defined in package.json #124

Open
AlexW00 opened this issue Jun 17, 2023 · 3 comments
Open

No "export" main defined in package.json #124

AlexW00 opened this issue Jun 17, 2023 · 3 comments

Comments

@AlexW00
Copy link

AlexW00 commented Jun 17, 2023

  • wikibase-sdk version: v9 (latest)
  • Environment: node
  1. Install wikibase-sdk via npm i wikibase-sdk
  2. Try to run your code
  3. Get error:
Error: No "exports" main defined in /home/aw/Developer/Work/graph-it/graphit-app/api/node_modules/wikibase-sdk/package.json
    at new NodeError (node:internal/errors:387:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:439:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:663:7)
    at resolveExports (node:internal/modules/cjs/loader:493:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
    at Function.Module._resolveFilename (/home/aw/Developer/Work/graph-it/graphit-app/node_modules/tsconfig-paths/src/register.ts:115:36)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
[ERROR] 20:33:14 Error: No "exports" main defined in /home/aw/Developer/Work/graph-it/graphit-app/api/node_modules/wikibase-sdk/package.json
Child got SIGTERM, exiting.

My tsconfig:

{
	"compilerOptions": {
		"baseUrl": ".",
		"sourceRoot": "src",
		"module": "commonjs",
		"target": "esnext",
		"sourceMap": true,
		"declaration": false,
		"experimentalDecorators": true,
		"emitDecoratorMetadata": true,
		"moduleResolution": "node",
		"isolatedModules": false,
		"suppressImplicitAnyIndexErrors": false,
		"noImplicitAny": false,
		"strictNullChecks": true,
		"noUnusedLocals": false,
		"noUnusedParameters": false,
		"allowSyntheticDefaultImports": true,
		"importHelpers": true,
		"newLine": "LF",
		"noEmit": true,
		"esModuleInterop": true,
		"resolveJsonModule": true,
		"lib": ["es7", "dom", "ESNext.AsyncIterable"],
		"typeRoots": ["../node_modules/@types"],
	},
	"include": ["src"],
	"linterOptions": {
		"exclude": []
	}
}

@AlexW00
Copy link
Author

AlexW00 commented Jun 17, 2023

monorepo issue

@AlexW00 AlexW00 closed this as completed Jun 17, 2023
@AlexW00
Copy link
Author

AlexW00 commented Jun 17, 2023

Actually it's not. V8 works, but v9 does not.

@AlexW00 AlexW00 reopened this Jun 17, 2023
@EdJoPaTo
Copy link
Contributor

v9 requires ES Modules and can not be used from CommonJS anymore

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