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.

TypeError: (0 , _stateLocal.create) is not a function

See original GitHub issue

I am using @monaco-editor/react@3.7.4 Screen Shot 2021-04-19 at 10 32 39 AM This is my simple code below

import MonacoEditor from "@monaco-editor/react";

function CodeEditor() {
  return <MonacoEditor height="400px" />;
}

export default CodeEditor;

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Prinzhorncommented, Apr 19, 2021

I think the @monaco-editor organization on npm is not official. So your bug report is probably better off in the actual repository at https://github.com/suren-atoyan/monaco-react and not here

1reaction
jidecommented, May 5, 2021

I had the same issue. It is caused by monaco-react having an unpinned dep to package state-local. Unfortunately, although the package had minor updates, its api broke.

To fix it, use yarn “resolutions” field: https://classic.yarnpkg.com/en/docs/selective-version-resolutions :

{
  ...
  "dependencies": {
    ...
    "state-local": "1.0.1"
  }
  ...
  "resolutions": {
    "@monaco-editor/react/state-local": "1.0.1"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: (0 , _createStore.default) is not a function
I removed brackets({}) in import and that fixed my problem. You can try this: import createStore from 'redux'.
Read more >
uncaught typeerror: (0 , react__ ...
When trying to edit a record I get the Error "navigator.block is not a function". Steps to reproduce: 1- User the Form Component...
Read more >
(0 , import_defineToJSON.default) is not a function - Bugs
When trying to import '@8base/auth' to a Vite+Vue 3 project, the following error is trigger by the import statement. Uncaught TypeError: (0 ......
Read more >
The Guide to Learning React Hooks (Examples & Tutorials)
Learn all about React Hooks with this hands-on guide. Includes tutorials and code examples on using hooks for state and effects, for context...
Read more >
HL7 Version 2.5.1 Implementation Guide: Immunization ... - CDC
Not a function under IIS. Constrain to 0 (zero). HL7 Version 2.5.1 Implementation Guide: Immunization Messaging (Release 1.5) 10/1/2014. Page 118 ...
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