Cannot read properties of undefined (reading 'localsInner')
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- markdown, react, typescript, webpack
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
Start with webpack.config.js, the dependency versions in package.json, and App.tsx to reproduce the localsInner failure in a minimal React application. Compare the module versions and imports used in issue #409, then run the development build to confirm the runtime error is gone. Also verify how the default preset enables the table toolbar command in WYSIWYG mode.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have the same problem that was described here earlier. But nothing changed for me after switching package managers (npm, yarn, pnpm, etc.).
I changed the versions of your package, used your examples to create a React application, but this error always remains.
there're my configs:
webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
mode: "development",
entry: "./src/index.tsx",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: "esbuild-loader",
options: {
loader: 'jsx',
target: 'es2020',
format: "cjs",
},
},
{
test: /\.(ts|tsx)$/,
loader: "esbuild-loader",
options: {
loader: "tsx",
target: "esnext",
format: "cjs",
},
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
],
},
resolve: {
fallback: {
http: false,
https: false,
stream: false,
fs: false,
process: false,
path: false,
url: false,
punycode: false,
buffer: false,
},
extensions: [".js",".jsx",".ts",".tsx"],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: "./public/index.html",
}),
],
devServer: {
static: path.join(__dirname, "dist"),
compress: true,
port: 3001,
},
};
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"jsx": "react-jsx",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "bundler"
},
"include": ["src"]
}
dependencies in package.json
"@diplodoc/transform": "^4.47.2",
"@gravity-ui/markdown-editor": "^15.1.0",
"@gravity-ui/uikit": "^7.4.0",
"highlight.js": "^11.11.1",
"lodash": "^4.17.21",
"lowlight": "^3.3.0",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"react": "^18.0.2",
"react-dom": "^18.0.2"
and my App.tsx
import React from 'react';
import { ThemeProvider, ToasterProvider, configure } from '@gravity-ui/uikit';
import { toaster } from '@gravity-ui/uikit/toaster-singleton';
import { useMarkdownEditor, MarkdownEditorView } from '@gravity-ui/markdown-editor';
import '@gravity-ui/uikit/styles/styles.css';
function Editor({ onSubmit }: any) {
const editor = useMarkdownEditor({
preset: "default",
md: {
html: false,
},
initial: {
markup: content,
mode: "wysiwyg",
toolbarVisible: true,
splitModeEnabled: true
}
});
React.useEffect(() => {
function submitHandler() {
// Serialize current content to markdown markup
const value = editor.getValue();
onSubmit(value);
}
editor.on('submit', submitHandler);
return () => {
editor.off('submit', submitHandler);
};
}, [onSubmit]);
return <MarkdownEditorView stickyToolbar autofocus editor={editor} />;
}
export default function App() {
return (
<ThemeProvider>
<ToasterProvider toaster={toaster}>
<Editor onSubmit={(value: any) => console.log(value)} />
</ToasterProvider>
</ThemeProvider>
);
}
To better understand the situation, I can create a repository with the project.
And additionally, I would like to ask. You have a preset for working with pure Markdown, specifically the "default" preset, which should also include a table, but it's not in the toolbar and it's unclear how to create it in WYSIWYG mode?
- Ngôn ngữ chính
- TypeScript
- Star
- 428
- Fork
- 48
- Merge trung bình
- 5 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 47
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gravity-ui/markdown-editor
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
gravity-ui/markdown-editor#1452 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
gravity-ui/markdown-editor#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Markup mode: `colorify` does not detect existing `{color}(...)` wrapper when switching colorsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
gravity-ui/markdown-editor#1129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
gravity-ui/markdown-editor#1450 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
gravity-ui/markdown-editor#1331 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của gravity-ui/markdown-editor
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openclaw/openclaw#199885 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
feature needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sequant-io/sequant#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100