-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Error: Cannot unlock an object that was not locked before - with ASP.Net MVC #252
Comments
Did you ever figure out the issue with this? It happens to me sporadically |
Getting this as well. |
Same. On a vanilla Vitejs react application, just threw it in to test how this worked but got the same error:
|
I managed to fix this on my setup by adding overrides to my package.json and fixing the react version: "overrides": { |
What version of Also cross linking to similar for people like me who don't look properly: #248 |
The issue seems to arise when there are multiple instances of @wordpress/private-apis in the dependency tree. Since the various An easy way to check for this is to look for The root cause seems to be a version mismatch between dependencies. When I looked in the sub packages, each instance of the Full disclosure: |
Same here. I am trying to get the isolated-block-editor to work in a simple React App. It compiles fine with the package.json below but throws an 'Error: Cannot unlock an object that was not locked before.' when i open it up in a browser. Every help is greatly appreciated. { |
I was having this issue as well. The solution I came up with was to alias the @WordPress namespace in my webpack config:
This ensured I only had ONE version of private-apis and all the other @WordPress libraries in my bundle (like 2500 fewer modules). |
I am integrating Isolated Block Editor to my Asp.Net MVC application through React JS. I am getting the error:
Uncaught Error: Cannot unlock an object that was not locked before at unlock (implementation.js:141:1)
Dependencies information:
"dependencies": {
"babel-preset-env": "^1.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@automattic/isolated-block-editor": "^2.28.0",
"@wordpress/dependency-extraction-webpack-plugin": "^4.30.0",
"webpack": "^5.89.0",
}
Editor.js:
import React from 'react';
import '@automattic/isolated-block-editor/build-browser/core.css';
import IsolatedBlockEditor from '@automattic/isolated-block-editor';
const settings = {
iso: {
moreMenu: false,
},
};
const Editor = () => {
return (
<IsolatedBlockEditor
settings={settings}
onLoad={(parser, rawHandler) => {
console.log('parser: ', parser)
console.log('rawHandler: ', rawHandler)
}}
onSaveContent={(content) => {
console.log('onContentSave')
}}
onError={() => {
console.log('error')
}}
>
);
};
export default Editor;
index.js:
import React from 'react';
import { createRoot } from 'react-dom/client';
import Editor from './Editor';
const rootElement = document.getElementById('root');
const root = createRoot(rootElement);
root.render(
//Render Editor here
);
Can you please tell me what I am missing?
The text was updated successfully, but these errors were encountered: