Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Uncaught ReferenceError: require is not defined #59

Open
raygence13 opened this issue May 11, 2022 · 3 comments
Open

Uncaught ReferenceError: require is not defined #59

raygence13 opened this issue May 11, 2022 · 3 comments

Comments

@raygence13
Copy link

when building a vite app that uses vue-katex, the build breaks due to const merge = require('deepmerge')
i've been able to fix this manually by copying the katex-directive.js code in my plugin.js file, and changing the line above to import merge from 'deepmerge'

@hsorby
Copy link

hsorby commented May 13, 2022

Did you do this with Vite + Vue 2? or Vite + Vue 3? Just wondering if this could have worked with Vite + Vue 3.

@hsorby
Copy link

hsorby commented May 13, 2022

Nevermind, I'm guessing it was Vite + Vue 2.

@hhaensel
Copy link

hhaensel commented Feb 22, 2023

Alternatively, you can use the existing vue-katex.umd.js and change the line

// var o=require("deepmerge"),r=require("deepmerge");
var o = deepmerge, r = deepmerge;

and add deepmerge.umd.js to your dependencies if you don't have a vue installation on your computer to rebuild the files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants