Skip to content

Conversation

@oooplz
Copy link

@oooplz oooplz commented Dec 14, 2021

graphql-tag working with ssr will be throwing Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

The full exception in here.

(node:7884) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/zc/projects/foo/node_modules/tslib/tslib.es6.js:24
export function __extends(d, b) {
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1001:16)
    at Module._compile (internal/modules/cjs/loader.js:1049:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async __instantiateModule__ (file:///Users/zc/projects/foo/.nuxt/dist/server/server.mjs:12083:3)
[vite dev] Error loading external "/Users/zc/projects/foo/node_modules/tslib/tslib.es6.js".
  at file://./.nuxt/dist/server/server.mjs:6149:277  
  at async __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:12083:3)
[vite dev] Error loading external "/Users/zc/projects/foo/node_modules/tslib/tslib.es6.js".
  at file://./.nuxt/dist/server/server.mjs:6149:277  
  at async __instantiateModule__ (file://./.nuxt/dist/server/server.mjs:12083:3)

reworked

@oooplz oooplz closed this Dec 14, 2021
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

Successfully merging this pull request may close these issues.

1 participant