mathematic-inc / codemirror-tex Goto Github PK
View Code? Open in Web Editor NEWA monorepo for all TeX-related CodeMirror projects
License: GNU General Public License v3.0
A monorepo for all TeX-related CodeMirror projects
License: GNU General Public License v3.0
Describe the bug
Uncaught ReferenceError: cp is not defined
is it possible to find the implemention of the cp which function declared in types-internal.d.ts
?
I am getting an error with this package when trying to make use of it in a codemirror project.
I'm a newbie to codemirror, and just a dabbler not a full time programmer so bear with me.
The error for me can be produced as easily as the following:
Create a new project with npm init
.
Install codemirror and rollup/@rollup-plugin-node-resolve along with this project: npm install codemirror lang-tex rollup @rollup/plugin-node-resolve
.
Create a javascript module that loads the package. I can get the problem with something as simple as this:
import {EditorView, basicSetup} from "codemirror";
import {texSyntax} from "lang-tex";
let editor = new EditorView({
extensions: [basicSetup, texSyntax()],
parent: document.body
});
export default editor;
node_modules/.bin/rollup editor.mjs -f iife -o editor.bundle.js -p @rollup/plugin-node-resolve
as suggested here.When I do so I get this output:
editor.mjs → editor.bundle.js...
(!) "this" has been rewritten to "undefined"
https://rollupjs.org/troubleshooting/#error-this-is-undefined
node_modules/lang-tex/lib/index.js
1: "use strict";
2: var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
^
3: if (k2 === undefined) k2 = k;
4: Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
...and 3 other occurrences
[!] RollupError: "texSyntax" is not exported by "node_modules/lang-tex/lib/index.js", imported by "editor.mjs".
https://rollupjs.org/troubleshooting/#error-name-is-not-exported-by-module
editor.mjs (3:8)
1:
2: import {EditorView, basicSetup} from "codemirror";
3: import {texSyntax} from "lang-tex";
^
4:
5: let editor = new EditorView({
at error (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:349:30)
at Module.error (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:15073:16)
at Module.traceVariable (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:15498:29)
at ModuleScope.findVariable (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:14023:39)
at Identifier.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:9743:40)
at CallExpression.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:7363:23)
at CallExpression.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:11309:15)
at ArrayExpression.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:7359:28)
at Property.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:7363:23)
at ObjectExpression.bind (/home/frabjous/tmp/textest/node_modules/rollup/dist/shared/rollup.js:7359:28)
The expected behavior is that I not get this error, and that I be able to use the extension in a simple codemirror instance.
It's possible I just didn't install things right. Again, newbie.
I did get a lot of deprecation warnings about lezer packages when installing lang-tex, which may or may not be relevant.
Note I posted about this in the codemirror discussion forum here but didn't get any replies.
Is your feature request related to a problem? Please describe.
is there any plan to upload to npm repository so that can easily install by using command.
Describe the solution you'd like
upload the dependencies as npm package
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.