Visitar URL original
TypeError: Class extends value undefined is not a constructor or null · Issue #158 · honojs/node-server · GitHub
Skip to content

TypeError: Class extends value undefined is not a constructor or null #158

Open

Description

@thathurtabit

Hello. I'm not sure if this is down to always annoying CJS/MJS issue(s), but when building my app through Docker, I get the following error, despite being able to build the app successfully when running locally.

Error:

 ⠋ Container atds-usage-reports-app-1  Recreated                                                                                                                                                                          0.0s 
Attaching to app-1
app-1  | /usr/local/namespace/app/node_modules/@hono/node-server/dist/index.js:46
app-1  | var Request = class extends GlobalRequest {
app-1  |               ^
app-1  | 
app-1  | TypeError: Class extends value undefined is not a constructor or null
app-1  |     at Object.<anonymous> (/usr/local/namespace/app/node_modules/@hono/node-server/dist/index.js:46:15)
app-1  |     at Module._compile (node:internal/modules/cjs/loader:1369:14)
app-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
app-1  |     at Module.load (node:internal/modules/cjs/loader:1206:32)
app-1  |     at Module._load (node:internal/modules/cjs/loader:1022:12)
app-1  |     at Module.require (node:internal/modules/cjs/loader:1231:19)
app-1  |     at require (node:internal/modules/helpers:179:18)
app-1  |     at Object.<anonymous> (/usr/local/autotrader/app/dist/index.js:3:23)
app-1  |     at Module._compile (node:internal/modules/cjs/loader:1369:14)
app-1  |     at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
app-1  | 
app-1  | Node.js v20.12.1
app-1 exited with code 1

Looking at my node_modules locally (node_modules/@hono/node-server/dist/index.js:46:15) things do seem to be fine.

Screenshot 2024-04-15 at 15 44 40

I'm really confused as to why by build (only in Docker) seems to not know about the GlobalRequest class declared above.

Activity

  1. charlieforward9 commented on Jul 4, 2024

    @charlieforward9

    I am also having this error when trying to build Vite on GitHub Pages. Everything checks off locally, dev/build/preview

    `at file:///home/runner/work/.../node_modules/@hono/node-server/dist/index.mjs:20:15`
    
  2. charlieforward9 commented on Jul 4, 2024

    @charlieforward9

    Dependent issue: aidenybai/million#1071

  3. abhishiv commented on Aug 6, 2024

    @abhishiv

    Old node version I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions