debate-map / app

Monorepo for the client, server, etc. of the Debate Map website.
https://debatemap.app
MIT License
73 stars 16 forks source link

Fix that GenerateSeedDB.ts is failing to run (due to the ever-annoying fragility of commonjs/esm import mismatching...) #241

Open Venryx opened 1 year ago

Venryx commented 1 year ago

Error:

file:///C:/Root/Apps/@V/DebateMap/Main/.yalc/web-vcore/.yalc/mobx-graphlink/Dist/Tree/QueryParams.js:1
import { gql } from "@apollo/client";
         ^^^
SyntaxError: Named export 'gql' not found. The requested module '@apollo/client' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@apollo/client';
const { gql } = pkg;

    at ModuleJob._instantiate (internal/modules/esm/module_job.js:120:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:165:5)
    at async Loader.import (internal/modules/esm/loader.js:177:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
The script called "db.buildSeedDBScript" which runs "cross-env TS_NODE_SKIP_IGNORE=true TS_NODE_PROJECT=./Scripts/SeedDBGenerator/tsconfig.json TS_NODE_TRANSPILE_ONLY=true  node --loader ts-node/esm.mjs --experimental-specifier-resolution=node ./Scripts/SeedDBGenerator/GenerateSeedDB.ts" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code