Skip to content
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

Error when editing link in lexical #8802

Closed
udany opened this issue Oct 21, 2024 · 2 comments
Closed

Error when editing link in lexical #8802

udany opened this issue Oct 21, 2024 · 2 comments
Labels

Comments

@udany
Copy link

udany commented Oct 21, 2024

Link to reproduction

No response

Describe the Bug

When clicking the edit button on a link in lexical the following error happens:

Uncaught TypeError: toggleModal is not a function
    at onClick (index.tsx:307:19)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:25)
    at executeDispatch (react-dom.development.js:9041:3)
    at processDispatchQueueItemsInOrder (react-dom.development.js:9073:7)
    at processDispatchQueue (react-dom.development.js:9086:5)
    at dispatchEventsForPlugins (react-dom.development.js:9097:3)
    at react-dom.development.js:9288:12

The error points to the fact toggleModal is undefined when called.

Debugging in devtools I found out useModal is returning {}.

To Reproduce

It's a relatively fresh project, started with npx create-payload-app@latest and added @payloadcms/richtext-lexical

Here's my payload config:

export default buildConfig({
	admin: {
		user: Users.slug,
		bundler: webpackBundler(),
		meta: {
			favicon: '/public/favicon.png'
		},
		dateFormat: 'dd/MM/yyyy HH:mm:ss',
	},
	editor: lexicalEditor(),
	collections: [
		Users, Articles, Media
	],
	typescript: {
		outputFile: path.resolve(__dirname, 'payload-types.ts'),
	},
	graphQL: {
		schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
	},
	plugins: [payloadCloud(), addLastModified],
	db: postgresAdapter({
		pool: {
			connectionString: process.env.DATABASE_URI,

		},
	})
})
  "dependencies": {
    "@payloadcms/bundler-vite": "^0.1.7",
    "@payloadcms/bundler-webpack": "^1.0.0",
    "@payloadcms/db-postgres": "^0.x",
    "@payloadcms/plugin-cloud": "^3.0.0",
    "@payloadcms/richtext-lexical": "^0.11.3",
    "cross-env": "^7.0.3",
    "dotenv": "^8.2.0",
    "express": "^4.19.2",
    "payload": "^2.0.0"
  },

Payload Version

2.0.0

Adapters and Plugins

db-postgres, bundler-webpack,

@udany udany added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Oct 21, 2024
@udany
Copy link
Author

udany commented Oct 21, 2024

Updating to ^0.11.4 magically fixed it

@udany udany closed this as completed Oct 21, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 21, 2024
Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant