James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.53k stars 522 forks source link

Undefined references, asking to rerun Biber #2340

Closed sulaymandesai closed 3 years ago

sulaymandesai commented 3 years ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Describe the bug [Required]

I am using a simple harvard referencing template. I have a .bib file which is being located and contains references. However, a problem arises where my system says there are undefined references and it says the bibliography is empty. The problem says I need to run Biber on the file then rerun LaTeX. I have no idea how to do this.

To Reproduce

Steps to reproduce the behavior:

  1. Create .tex file using: https://www.overleaf.com/read/bwkshgdxnwqp
  2. Create Sample.bib and build pdf.
  3. See error: There were undefined references. [1,1] Please (re)run Biber on the file: (biblatex) main (biblatex) and rerun LaTeX afterwards. Empty bibliography.

Expected behavior

I expected the pdf to build like it does in overleaf, with citations appearing properly.

Logs [Required]

[19:53:25] Initializing LaTeX Workshop.
[19:53:25] Extension root: /Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2
[19:53:25] Creating PDF file watcher.
[19:53:25] Creating LaTeX Workshop http and websocket server.
[19:53:25] LaTeX Workshop initialized.
[19:53:25] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:53:25] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:26] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:26] Root file changed: from undefined to /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:26] Start to find all dependencies.
[19:53:26] Instantiating a new file watcher for /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:26] Creating Bib file watcher.
[19:53:26] Parsing a file and its subfiles: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:26] Cannot find .bib file: sample.bib
[19:53:26] Parse fls file.
[19:53:26] Fls file found: /Users/sulaymandesai/Documents/Year_4/latex/main.fls
[19:53:26] Parse aux file: /Users/sulaymandesai/Documents/Year_4/latex/main.aux
[19:53:26] Server created on 127.0.0.1:63346
[19:53:26] Added to file watcher: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:26] LaTeX Workshop version: 8.13.2
[19:53:26] Snippet data loaded.
[19:53:32] LOG command invoked.
[19:53:32] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:53:32] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:32] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:32] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:45] VIEW command invoked with mode: file:///Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:45] Active document is not a TeX file.
[19:53:48] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:53:48] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:48] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:48] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:54] BUILD command invoked.
[19:53:54] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:53:54] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:54] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:54] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:54] Building root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:54] Build root file /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:54] Recipe step 1: latexmk, -synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=/Users/sulaymandesai/Documents/Year_4/latex,/Users/sulaymandesai/Documents/Year_4/latex/main
[19:53:54] cwd: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:54] LaTeX build process spawned. PID: 58560.
[19:53:54] Recipe of length 1 finished. PID: 58560.
[19:53:54] Successfully built /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:54] No PDF viewer connected for /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:53:54] Parse fls file.
[19:53:54] Fls file found: /Users/sulaymandesai/Documents/Year_4/latex/main.fls
[19:53:54] Parse aux file: /Users/sulaymandesai/Documents/Year_4/latex/main.aux
[19:53:59] VIEW command invoked with mode: file:///Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:59] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:53:59] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:53:59] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:53:59] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:53:59] Serving PDF file at http://localhost:63346/viewer.html?file=pdf..JTJGVXNlcnMlMkZzdWxheW1hbmRlc2FpJTJGRG9jdW1lbnRzJTJGWWVhcl80JTJGbGF0ZXglMkZtYWluLnBkZg
[19:53:59] The encoded path is /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:54:00] Open PDF tab for /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:54:00] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:54:00] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:54:00] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:00] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:54:00] Handle data type: open
[19:54:00] Preview PDF file: /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:54:00] Handle data type: request_params
[19:54:00] Sending the settings of the PDF viewer for initialization: {"type":"params","scale":"auto","trim":0,"scrollMode":0,"spreadMode":0,"hand":false,"invertMode":{"enabled":false,"brightness":1,"grayscale":0.6,"hueRotate":180,"invert":0,"sepia":0},"bgColor":"#ffffff","keybindings":{"synctex":"double-click"}}
[19:54:01] Handle data type: loaded
[19:54:01] SyncTex after build invoked.
[19:54:01] SyncTeX failed.
[19:54:01] Cannot convert undefined or null to object
[19:54:01] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at getBlocks (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/synctex.js:106:29)
    at Object.syncTexJsForward (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/synctex.js:89:21)
    at Locator.syncTeX (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/locator.js:154:42)
    at Viewer.handler (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/viewer.js:441:44)
    at WebSocket.<anonymous> (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/server.js:55:68)
    at WebSocket.emit (events.js:223:5)
    at Receiver.receiverOnMessage (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/websocket.js:720:20)
    at Receiver.emit (events.js:223:5)
    at Receiver.dataMessage (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:414:14)
    at Receiver.getData (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:346:17)
    at Receiver.startLoop (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:133:22)
    at Receiver._write (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:69:10)
    at doWrite (_stream_writable.js:435:12)
    at writeOrBuffer (_stream_writable.js:419:5)
    at Receiver.Writable.write (_stream_writable.js:309:11)
    at Socket.socketOnData (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/websocket.js:795:35)
    at Socket.emit (events.js:223:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:181:23)
[19:54:25] BUILD command invoked.
[19:54:25] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:54:25] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:54:25] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:25] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:54:25] Building root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:25] Build root file /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:25] Recipe step 1: latexmk, -synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=/Users/sulaymandesai/Documents/Year_4/latex,/Users/sulaymandesai/Documents/Year_4/latex/main
[19:54:25] cwd: /Users/sulaymandesai/Documents/Year_4/latex
[19:54:25] LaTeX build process spawned. PID: 58569.
[19:54:25] Recipe of length 1 finished. PID: 58569.
[19:54:25] Successfully built /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:54:25] Refresh PDF viewer for /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:54:25] Parse fls file.
[19:54:25] Fls file found: /Users/sulaymandesai/Documents/Year_4/latex/main.fls
[19:54:25] Parse aux file: /Users/sulaymandesai/Documents/Year_4/latex/main.aux
[19:54:25] Preview PDF file: /Users/sulaymandesai/Documents/Year_4/latex/main.pdf
[19:54:25] Handle data type: loaded
[19:54:25] SyncTex after build invoked.
[19:54:25] SyncTeX failed.
[19:54:25] Cannot convert undefined or null to object
[19:54:25] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at getBlocks (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/synctex.js:106:29)
    at Object.syncTexJsForward (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/synctex.js:89:21)
    at Locator.syncTeX (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/locator.js:154:42)
    at Viewer.handler (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/viewer.js:441:44)
    at WebSocket.<anonymous> (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/out/src/components/server.js:55:68)
    at WebSocket.emit (events.js:223:5)
    at Receiver.receiverOnMessage (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/websocket.js:720:20)
    at Receiver.emit (events.js:223:5)
    at Receiver.dataMessage (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:414:14)
    at Receiver.getData (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:346:17)
    at Receiver.startLoop (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:133:22)
    at Receiver._write (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/receiver.js:69:10)
    at doWrite (_stream_writable.js:435:12)
    at writeOrBuffer (_stream_writable.js:419:5)
    at Receiver.Writable.write (_stream_writable.js:309:11)
    at Socket.socketOnData (/Users/sulaymandesai/.vscode/extensions/james-yu.latex-workshop-8.13.2/node_modules/ws/lib/websocket.js:795:35)
    at Socket.emit (events.js:223:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:181:23)
[19:54:50] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:54:50] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:54:50] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:50] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:54:52] Handle data type: reverse_synctex
[19:54:52] SyncTeX to file /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:52] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:54:52] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:54:52] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:54:52] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.
[19:55:08] Handle data type: reverse_synctex
[19:55:08] SyncTeX to file /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:55:08] Current workspace folders: ["file:///Users/sulaymandesai/Documents/Year_4/latex"]
[19:55:08] Current workspaceRootDir: /Users/sulaymandesai/Documents/Year_4/latex
[19:55:08] Found root file from active editor: /Users/sulaymandesai/Documents/Year_4/latex/main.tex
[19:55:08] Keep using the same root file: /Users/sulaymandesai/Documents/Year_4/latex/main.tex.

Developer Tools Console [Required]

To access the log, click 'help' -> 'Toggle Developer Tools' -> 'Console'. Paste anything suspicious.

(node:58496) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

[Embedded Page] PDF d9c4ea831cf7544f1c280883aed9546c [1.5 pdfTeX-1.40.21 / TeX] (PDF.js: 2.4.456)
webviewElement.ts:150 [Embedded Page] Uncaught TypeError: Cannot set property 'type' of undefined
webviewElement.ts:150 [Embedded Page] PDF d9c4ea831cf7544f1c280883aed9546c [1.5 pdfTeX-1.40.21 / TeX] (PDF.js: 2.4.456)
DevTools failed to load SourceMap: Could not load content for file:///Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/semver-umd/lib/semver-umd.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/tas-client-umd/lib/tas-client-umd.js.map: 
DevTools failed to load SourceMap: Could not load content for file:///Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js.map: 

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop [Required]

Additional questions

Are you using VSCodium?

No

Are you using LaTeX Workshop with VS Code Remote?

No

If the answer is Yes, please write which one you are using. Write the versions of the remote extension.

Additional context

I'm quite new to coding and using latex on vsocde, always used overleaf and want to use a version of overleaf locally.

sulaymandesai commented 3 years ago

Also have the below problem. Not sure if it means anything.

inputenc package ignored with utf8 based engines.
jlelong commented 3 years ago

From the logs

[19:53:26] Cannot find .bib file: sample.bib

The sample.bib listed in \addbibresource{sample.bib} does not exist. In your post, you refer to Sample.bib with a capital S, make sure to use a lowercase s.

The inputenc warning is related to LaTeX usage not to the extension.

sulaymandesai commented 3 years ago
Screenshot 2020-10-23 at 21 14 05

The file is in the same folder. The spelling is all the same. Sorted out the other issue.

tamuratak commented 3 years ago

This is not related to LaTeX Workshop. Ask at https://tex.stackexchange.com/.

tamuratak commented 3 years ago

It is possible thatbiber fails with errors.

jlelong commented 3 years ago

The screenshot lists a samble.bib file not sample.bib.

sulaymandesai commented 3 years ago

My bad, corrected the spelling error but still got the same issue. What does biber failing with error mean? How do I fix this?

tamuratak commented 3 years ago

Ask at https://tex.stackexchange.com/.