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.

[Bug] The sample browser-esm-parcel is not working

See original GitHub issue

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Code

The sample browser-esm-parcel is not working.

Steps to reproduce:

git clone git@github.com:microsoft/monaco-editor.git
cd monaco-editor
cd samples/browser-esm-parcel
npm install
npm start

Open browser to http://localhost:1234/ to view the web page served Parcel’s dev server.

Open the dev console.

Actual Behavior

An empty box appears in the web page where the Monaco Editor should be rendered.

The following error is output to the dev console:

Uncaught TypeError: Cannot set property marked of #<Object> which has only a getter
    at index.975ef6c8.js:117651:24
    at index.975ef6c8.js:115678:72
    at index.975ef6c8.js:115682:7
    at Object.jVSjm.@parcel/transformer-js/src/esmodule-helpers.js (index.975ef6c8.js:117664:3)
    at newRequire (index.975ef6c8.js:71:24)
    at localRequire (index.975ef6c8.js:84:35)
    at Object.5JIxC../dom.js (index.975ef6c8.js:113756:17)
    at newRequire (index.975ef6c8.js:71:24)
    at localRequire (index.975ef6c8.js:84:35)
    at Object.6TtqN.../../../../base/browser/markdownRenderer.js (index.975ef6c8.js:113600:27)

Expected Behavior

I expect to see Monaco Editor working in the web page and no errors in the dev console.

Additional Context

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:9
  • Comments:7

github_iconTop GitHub Comments

2reactions
jeffawangcommented, Mar 3, 2022

I had a similar issue when trying to use monaco-editor in another project. I was able to get it working by specifying monaco-editor version 0.31.0. Likewise, this sample works after specifying monaco-editor version 0.31.0 in the sample’s package.json.

One difference I notice is that the latest monaco-editor uses version 4.0.12 of marked, while the older monaco-editor that works uses version 3.0.8 version of marked.

I think it’s a transitive dependency, and I haven’t dug deeper into it.

$ git rev-parse --short HEAD
db5039b7
$ yarn why marked
yarn why v1.22.17
...
=> Found "marked@4.0.12"
info Reasons this module exists
   - "typedoc" depends on it
   - Hoisted from "typedoc#marked"
...
1reaction
PredokMiFcommented, Sep 21, 2022

I got same issue. Version downgrade was helped me:

monaco-editor@0.31.1
@monaco-editor/loader@1.3.2
@monaco-editor/react@4.4.5```
Read more comments on GitHub >

github_iconTop Results From Across the Web

Parcel 2 RC
One place where this was not true in Parcel v1 was the way Parcel handled ... Screenshot of an error message showing "Browser...
Read more >
webbrowser — Convenient web-browser controller — Python ...
Usage example: ... This module does not work or is not available on WebAssembly platforms ... Exception raised when a browser control error...
Read more >
Browser support
Targeting such a wide range of browsers is challenging because they do not support all features of modern browsers. You compensate by loading...
Read more >
package.json
These are helpful for people who encounter issues with your package. ... If a url is provided, it will be used by the...
Read more >
How to Bundle a Web App with Parcel.js
If this happens, you can try refreshing the browser. If you're still having a problem, stop your server from running by pressing CTRL+C...
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