question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

Cannot convert undefined or null to object

See original GitHub issue

Environment

Operating System: windows 10 Node Version: v16.17.0 Nuxt Version: 2.16.0-27717142.54e852f Bridge Version: npm:@nuxt/bridge-edge@^3.0.0-27718044.2f69fe0 Nitro Version: false Package Manager: npm@8.19.1 Builder: webpack Runtime Modules: -

Reproduction

https://github.com/wtagain/nuxt-bug-template

Describe the bug

as the issue https://github.com/nuxt/bridge/issues/369 Iโ€™ve disable the nitro

import { defineNuxtConfig } from "@nuxt/bridge";

export default defineNuxtConfig({
  bridge: {
    nitro: false,
  },
});

then I use nuxt build and use nuxt start

FATAL Cannot convert undefined or null to object

Additional context

No response

Logs

C:\code\nuxt-bug-template>npx nuxt build
i Production build                                                                                                                                                                                                                                                                                               00:31:35
i Bundling for server and client side                                                                                                                                                                                                                                                                            00:31:35
i Target: server                                                                                                                                                                                                                                                                                                 00:31:35  
โˆš Builder initialized                                                                                                                                                                                                                                                                                            00:31:35  
โˆš Nuxt files generated                                                                                                                                                                                                                                                                                           00:31:35

โœ” Client
  Compiled successfully in 8.58s

โœ” Server
  Compiled successfully in 1.31s


Hash: 570b483c47c0911f454b
Version: webpack 4.46.0
Time: 8581ms
Built at: 2022/09/14 00:31:45
                         Asset       Size  Chunks                         Chunk Names
../server/client.manifest.json   12.4 KiB          [emitted]
                    016a953.js   2.29 KiB       3  [emitted] [immutable]  runtime
                    0771d55.js    218 KiB       1  [emitted] [immutable]  commons/app
                    36500ce.js   43.3 KiB       0  [emitted] [immutable]  app
                    87ebd97.js  242 bytes       2  [emitted] [immutable]  pages/index
                      LICENSES  472 bytes          [emitted]
                    e78b2b8.js   54.3 KiB       4  [emitted] [immutable]  vendors/app
 + 2 hidden assets
Entrypoint app = 016a953.js 0771d55.js e78b2b8.js 36500ce.js

Hash: 76b61f98b8323ad00600
Version: webpack 4.46.0
Time: 1315ms
Built at: 2022/09/14 00:31:46
               Asset       Size  Chunks             Chunk Names
      pages/index.js   2.01 KiB       1  [emitted]  pages/index
           server.js    358 KiB       0  [emitted]  app
server.manifest.json  207 bytes          [emitted]
 + 2 hidden assets
Entrypoint app = server.js server.js.map
i Ready to run nuxt start                                                                                                                                                                                                                                                                                        00:31:46

C:\code\nuxt-bug-template>npx nuxt start

 FATAL  Cannot convert undefined or null to object                                                                                                                                                                                                                                                               00:32:07  

  at Function.keys (<anonymous>)
  at node_modules\vue-server-renderer\build.prod.js:1:71756
  at vo (node_modules\vue-server-renderer\build.prod.js:1:71959)
  at new xo (node_modules\vue-server-renderer\build.prod.js:1:72923)
  at node_modules\vue-server-renderer\build.prod.js:1:78383
  at zo (node_modules\vue-server-renderer\build.prod.js:1:79262)
  at Object.createBundleRenderer (node_modules\vue-server-renderer\build.prod.js:1:80064)
  at SSRRenderer.createRenderer (node_modules\@nuxt\vue-renderer-edge\dist\vue-renderer.js:218:30)
  at new BaseRenderer (node_modules\@nuxt\vue-renderer-edge\dist\vue-renderer.js:40:29)
  at new SSRRenderer (node_modules\@nuxt\vue-renderer-edge\dist\vue-renderer.js:178:1)


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                           โ”‚
   โ”‚   โœ– Nuxt Fatal Error                                      โ”‚
   โ”‚                                                           โ”‚
   โ”‚   TypeError: Cannot convert undefined or null to object   โ”‚
   โ”‚                                                           โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dargmueslicommented, Sep 14, 2022

Iโ€™ve created a minimal reproduction: https://codesandbox.io/s/bridge-cannot-convert-undefined-null-3yv6z7?file=/package.json Edit: you need to run a build and start in the console to see that error.

0reactions
wtagaincommented, Sep 15, 2022

@dargmuesli I canโ€™t reproduce with latest bridge with your reproduction, in that caseโ€ฆ

@danielroe Awesome! So when the bridge option vite is false, nitro is false, which command do I use to build, nuxi build or nuxt build ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot convert undefined or null to object - Stack Overflow
Generic answer. This error is caused when you call a function that expects an Object as its argument, but pass undefined or null...
Read more >
Cannot convert undefined or null to Object in JavaScript
The "Cannot convert undefined or null to Object" error occurs when we pass a null or an undefined value to a function that...
Read more >
Object.keys(null) possible - cannot convert undefined or null to ...
Conditions above this line allow msg===null to get into Object.keys(msg);. livedata_connection.js:1626 Uncaught TypeError: Cannot convertย ...
Read more >
Edit Profile script issue: Cannot convert undefined or null to ...
Hi there, I'm getting this error Cannot convert undefined or null to object when editing profile using the /edit-profile page.
Read more >
Cannot convert undefined or null to object - JavaScript
JavaScript : How to resolve TypeError: Cannot convert undefined or null to object [ Gift : Animated Search Engineย ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found