VSCode error "Unexpected token # in JSON"
See original GitHub issueHi, for a few days I’ve been getting this error in VSCode:
As text:
[9:56:22 AM] ERROR: Exception while linting with markdownlint-cli2:
Error: Unable to parse '/Users/borekb/dev/shoptet/sofa/docs/docs/.markdownlint.jsonc'; Parser 0: Unexpected token # in JSON at position 0; Parser 1: A collection cannot be both a mapping and a sequence
at /Users/borekb/.vscode/extensions/davidanson.vscode-markdownlint-0.46.0/bundle.js:33:29570
at /Users/borekb/.vscode/extensions/davidanson.vscode-markdownlint-0.46.0/bundle.js:1:2260
In the terminal, all works fine:
$ yarn markdownlint-cli2 '**/*.md'
markdownlint-cli2 v0.1.3 (markdownlint v0.23.1)
Finding: **/*.md !**/node_modules/** !**/.next/** !**/dist/**
Linting: 80 file(s)
Summary: 0 error(s)
Also strange is that the VSCode error mentions a file /Users/borekb/dev/shoptet/sofa/docs/docs/.markdownlint.jsonc
which doesn’t exist on my disk and I’m not sure where it’s coming from.
The only markdownlint config we have in the repo is repo-root-level .markdownlint-cli2.js
with this content:
require('./.pnp.cjs').setup();
const path = require('path');
module.exports = {
config: {
MD007: {
indent: 4,
},
MD013: false,
MD014: false,
MD040: false,
MD029: false,
MD033: false,
MD026: false,
MD009: { br_spaces: 0 },
MD031: { list_items: false },
'graphql-examples': {
schema: path.join(__dirname, 'packages/graphql/schema.graphql'),
globs: [`${__dirname}/docs/docs/**/*.md{,x}`],
},
},
ignores: ['**/node_modules/**', '**/.next/**', '**/dist/**'],
customRules: ['@shoptet-private/markdownlint-graphql-examples'],
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:21 (11 by maintainers)
Top Results From Across the Web
Unexpected token # in JSON at position 0 when opening ...
I've tried your code in my project and nothing wrong. everything looks fine. Check the Jupyter Server network, try to restart vscode and ......
Read more >Unexpected token in JSON at position 262140 when ... - GitHub
Close all instances of VS Code. Go to, %USERPROFILE%/.vscode/extensions (on windows) or ~/.vscode/extensions on Linux/Mac.
Read more >Unexpected Token Error in VS Code - InterSystems community
I've checked the JSON settings file that VS Code uses, and they're fine and formatted properly. All of the settings I've entered are...
Read more >SyntaxError:Unexpected token < in JSON at position 4
SyntaxError :Unexpected token < in JSON at position 4.. AGAnonymized GDPR ... Visual Studio has persistent instabilities and malfunctions with that error.
Read more >How to Fix SyntaxError: Unexpected token < in JSON at ...
Usually this error is caused when your server returns HTML (which typically begins with <DOCTYPE html> or <html> ) instead of JSON. Valid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(I may still need an allow list for schemes for cases when a workspace is not open.)
I’ve tested the problematic scenario and all’s OK – that’s great! 🎉 Thanks a lot.