Closed moguixiaolin closed 1 year ago
Need more informations to resolve the issue, such as the version of Marp Core, the runtime operating environment, and whether or not a JavaScript bundler is used. Would you share the minimum reproducible if possible?
📝 This comment has been translated to English by the Marp team. For the community's discoverability and workability, we would appreciate your help in writing the description in English.
The operation is as follows:
import Marp from '@marp-team/marp-core'
const marp = new Marp()
Releases:
The page directly reports the following error:
Note: Only the new
operation is performed, nothing else.
Are you trying to use Marp Core on the Web page? Marp Core library is compatible with JavaScript server environment such as Node.js.
So for getting to work Marp Core on the web, you need to set up the JavaScript bundler properly. e.g. Native module polyfills for the browser environment. (If you were using Webpack, the setting for web extension of Marp for VS Code might help you)
For example, both of Marpit and Marp Core depend on PostCSS. https://github.com/postcss/postcss/issues/830 has mentioned that you need to pack JS with using proper browser polyfills to make PostCSS run in the browser.
📝 This comment has been translated to English by the Marp team. For the community's discoverability and workability, we would appreciate your help in writing the description in English.
@yhatt The vite 4.x version of the package does not eliminate the bug with the fallback setting.
📝 This comment has been translated to English by the Marp team. For the community's discoverability and workability, we would appreciate your help in writing the description in English.
My framework: vue + vite +ts The above typeerror issue with TS occurs in the browser runtime
If you're using Vite, you can inject Node.js polyfills through vite-plugin-node-polyfills.
📝 This comment has been translated to English by the Marp team. For the community's discoverability and workability, we would appreciate your help in writing the description in English.
ok, after injection, no other errors seen for now, thanks a lot for the solution @yhatt