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

Error: Cannot find module 'source-map-support/register' #29

Open
cfjedimaster opened this issue Mar 19, 2024 · 2 comments
Open

Error: Cannot find module 'source-map-support/register' #29

cfjedimaster opened this issue Mar 19, 2024 · 2 comments

Comments

@cfjedimaster
Copy link

Not sure what to add here but that's the error I get. Here's the entirety of the code:

process.loadEnvFile();

import { Table } from 'voici.js';

const API_KEY = process.env.GOOGLE_AI_KEY;

(async () => {
	let modelReq = await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${API_KEY}`);
	let models = await modelReq.json();
	const table = new Table(models);
	table.print();
})();

Full stacktrace:

node:internal/modules/cjs/loader:1142
  const err = new Error(message);
              ^

Error: Cannot find module 'source-map-support/register'
Require stack:
- /home/ray/projects/ai-testingzone/get_google_models/node_modules/voici.js/dist/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
    at Module._load (node:internal/modules/cjs/loader:983:27)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/ray/projects/ai-testingzone/get_google_models/node_modules/voici.js/dist/index.js:4:1)
    at Module._compile (node:internal/modules/cjs/loader:1368:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
    at Module.load (node:internal/modules/cjs/loader:1205:32)
    at Module._load (node:internal/modules/cjs/loader:1021:12)
    at cjsLoader (node:internal/modules/esm/translators:366:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/ray/projects/ai-testingzone/get_google_models/node_modules/voici.js/dist/index.js'
  ]
}
@aaarichter
Copy link

aaarichter commented Mar 20, 2024

Getting the same error - source-map-support is declared as dev dependency but is used in the dist files

@cfjedimaster a workaround is ad source-map-support to your project's dependencies or dev dependencies

@larswaechter
Copy link
Owner

Thanks for your feedback! I'll fix it at the end of next week when I'm 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

3 participants