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.

[build]: cannot read property 'code' of undefined

See original GitHub issue

Hey,

Thank you for this project, it’s really easy to use !

But unfortunately, I have an error when I’m trying to build:

$ npm run build 

> svelte-docs-template@0.3.1 build /home/benoitp/Work/perso/svmilli/docs_src
> rollup -c node_modules/@svelte-docs/core/rollup.config.js


/home/benoitp/Work/perso/svmilli/docs_src/node_modules/@svelte-docs/core/main.js → __DOCS__/dist/bundle.js...
(!) A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.
[!] (plugin rollup_plugin_fixident) TypeError: Cannot read property 'code' of undefined
TypeError: Cannot read property 'code' of undefined
    at Object.writeBundle (/home/benoitp/Work/perso/svmilli/docs_src/node_modules/@svelte-docs/core/rollup.config.js:247:63)
    at /home/benoitp/Work/perso/svmilli/docs_src/node_modules/rollup/dist/shared/rollup.js:18223:25
    at async Promise.all (index 0)
    at /home/benoitp/Work/perso/svmilli/docs_src/node_modules/rollup/dist/shared/rollup.js:18877:17
    at async Promise.all (index 0)
    at build (/home/benoitp/Work/perso/svmilli/docs_src/node_modules/rollup/dist/bin/rollup:1466:5)
    at runRollup (/home/benoitp/Work/perso/svmilli/docs_src/node_modules/rollup/dist/bin/rollup:1610:21)

I have updated some dependencies after I npm init svelte-docs, otherwise I couldn’t run the docs. So here my updated package:

{
  "dependencies": {
    "@svelte-docs/server": "^0.1.3",
    "milligram": "^1.3.0"
  },
  "devDependencies": {
    "@svelte-docs/core": "^0.10.1",
    "@svelte-docs/publisher": "^0.2.3",
    "@svelte-docs/themes": "^1.0.0",
    "npm-run-all": "^4.1.5",
    "rollup": "^2.10.0",
    "svelte": "^3.22.2"
  },
}

I try to look a bit around with the error logs I have no clue what’s going on !

Thanks for the help

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexxNBcommented, May 15, 2020

Yes, it is OK. Just test deploy on brand new repository with doc_src inside, created by npm init docs-svelte - it’s work. Then, I tried to deploy your repo - and also seems ok(till auth request). So I can’t reproduce this.

1reaction
AlexxNBcommented, May 15, 2020

And you can remove from the package.json:

 "rollup": "^2.10.0",
 "svelte": "^3.22.2"

In new template version I removed this lines, there are not necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JS/Ionic:TypeError: Cannot read property 'code' of undefined
The error I am getting is: TypeError: Cannot read property 'code' of undefined at services.js:65 What should I do to solve this error?...
Read more >
Cannot read property 'code' of undefined at Snowpack 3.8. ...
I've ran into this issue with css/scss files before and it usually means the file is empty, adding an empty .root {} class...
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
How to Prevent the Error: Cannot Read Property '0' of ...
Check your Code for Common Mistakes · Check for Undefined Before Accessing the Array · Provide an Alternative Value When the Array is...
Read more >
How to Avoid the Infamous "Cannot read properties of ...
In Regular Type Check Mode, TypeScript is aware that a function might return undefined . But at the same time, TypeScript infers the...
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