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

[nuxt] [request error] [unhandled] [500] Named export 'getPageBlocks' not found. #141

Open
spyderdsn opened this issue Dec 4, 2023 · 2 comments

Comments

@spyderdsn
Copy link

[3:26:14 PM]  ERROR  [nuxt] [request error] [unhandled] [500] Named export 'getPageBlocks' not found. The requested module 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs' 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 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs';
const { getPageBlocks, getPageTable } = pkg;

  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)


[3:26:14 PM]  ERROR  [nuxt] [request error] [unhandled] [500] Named export 'getPageBlocks' not found. The requested module 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs' 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 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs';
const { getPageBlocks, getPageTable } = pkg;

  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)


[3:26:14 PM]  ERROR  [nuxt] [request error] [unhandled] [500] Named export 'getPageBlocks' not found. The requested module 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs' 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 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs';
const { getPageBlocks, getPageTable } = pkg;

  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)


[3:26:14 PM]  ERROR  [nuxt] [request error] [unhandled] [500] Named export 'getPageBlocks' not found. The requested module 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs' 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 'file:///Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs';
const { getPageBlocks, getPageTable } = pkg;

  at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)  
  at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

  ├─ / (36ms)                                                                                                                                                                                                                                                 nitro 3:26:14 PM
  │ └── Error: [500] 
  ├─ /work (34ms)                                                                                                                                                                                                                                             nitro 3:26:14 PM
  │ └── Error: [500] 
  ├─ /200.html (32ms)                                                                                                                                                                                                                                         nitro 3:26:14 PM
  ├─ /404.html (32ms)                                                                                                                                                                                                                                         nitro 3:26:14 PM
                                                                                                                                                                                                                                                              nitro 3:26:14 PM
Errors prerendering:
  ├─ / (36ms)                                                                                                                                                                                                                                                 nitro 3:26:14 PM
  │ └── Error: [500] 
  ├─ /work (34ms)                                                                                                                                                                                                                                             nitro 3:26:14 PM
  │ └── Error: [500] 
                                                                                                                                                                                                                                                              nitro 3:26:14 PM

 ERROR  Exiting due to prerender errors.                                                                                                                                                                                                                            3:26:14 PM

  at prerender (node_modules/nitropack/dist/shared/nitro.0a84349b.mjs:216:11)
  at async node_modules/nuxt/dist/index.mjs:2992:7
  at async build (node_modules/nuxt/dist/index.mjs:4389:5)
  at async Object.run (node_modules/nuxi/dist/chunks/build.mjs:98:5)
  at async Object.run (node_modules/nuxi/dist/chunks/generate.mjs:59:5)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7) 

 ERROR  Exiting due to pretender errors.   

I'm running into this error when I run "generate": "nuxt generate". "nuxt dev" works fine.

Nuxt 3.8.2 with Nitro 2.8.1
Using Nitro server preset: static
vite v4.5.0 building for production...

@spyderdsn
Copy link
Author

spyderdsn commented Dec 4, 2023

import VueNotion, { getPageBlocks, getPageTable } from "vue-notion";

VS Code Note in the plugin file:

Could not find a declaration file for module 'vue-notion'. '/Users/user/website/node_modules/vue-notion/dist/vue-notion.umd.cjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vue-notion` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-notion';`ts(7016)
module "/Users/user/website/node_modules/vue-notion/dist/vue-notion.umd"

Screenshot 2023-12-04 at 3 45 32 pm

@spyderdsn
Copy link
Author

Adding:

build: { transpile: ["vue-notion"], },

to the nuxt.config.ts fixes the issue.

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

1 participant