electron-vue-vite not working after package? - electron

Source Code
The error message is
Uncaught ReferenceError: exports is not defined
The compiled code contains Object.defineProperty(exports,"__esModule",{value:!0})
Found a solution by google: <script> var exports = {}; </script>
but Cannot find module './Index.b211c312.js'
│ index.html
└─_assets
Index.b211c312.js
index.fa062449.js
style.032a3e7d.css
in index.html
<script type="module" src="./_assets/index.fa062449.js"></script>
in index.fa062449.js
require("./Index.b211c312.js")
How to solve this problem?

Update electron-vue-vite to the latest version, there is a fix!
https://github.com/electron-vite/vite-plugin-electron/issues/6#issuecomment-1144833465

Related

Webpacker load error (Uncaught TypeError: $(...).metisMenu is not a function)

Trying to get a (what should be) simple module to work: metisMenu
However, unfortunately I'm failing in doing so, apparently something in my Webpacker setup because when loading my page I get the error: Uncaught TypeError: $(...).metisMenu is not a function
There is an issue in loading the module in application.js. The module is being loaded in vendor/assets/javascripts/app.js
I have jQuery correctly installed
the following snippet into the head section makes it work (but this is without the use of Webpaker):
<script src="https://cdn.jsdelivr.net/npm/jquery"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://unpkg.com/metismenu"></script>
.
I've created a github branch. Please help! https://github.com/henkjanwils/metisMenu-error

jsPDF "Object expected" Exception in IE when trying to save the PDF

When trying to save the PDF file, the following stack trace occurs and the file is not downloaded:
TypeError: Object expected
at API.save (http://localhost:8080/applications/lib/jspdf/jspdf.debug.js:3648:11)
at Anonymous function (http://localhost:8080/applications/js/<my_custom_js_file>.js:288:12)
at Anonymous function (http://localhost:8080/applications/lib/angular-1.5.8/angular.min.js:158:482)
at e (http://localhost:8080/applications/lib/angular-1.5.8/angular.min.js:45:442)
at Anonymous function (http://localhost:8080/applications/lib/angular-1.5.8/angular.min.js:48:300)
Also tried with a simple example and had the same results:
var doc = new jsPDF();
doc.text("hello", 20, 20);
doc.save("table.pdf");
IE does not support native Promise. Therefore, the initialization script fails at line 12016 of Version 1.5.3:
SCRIPT5009: 'Promise' is undefined
jspdf.debug.js (12016,5)
Afterwards, the script is no longer initializing the required context.
A fix should be a 3rd party promise library - I have solved it by including the following resources before including jspdf.debug.js:
<script type="text/javascript" src="/applications/lib/ie-promise/es6-promise.js"></script>
<script type="text/javascript" src="/applications/lib/ie-promise/es6-promise#4/dist/es6-promise.auto.js"></script>

RequireJS does not work with jQuery Mobile

How should I include jquery.mobile.js in my project so that I can use it with RequireJS.
When I add jquery.mobile.js in my project I start getting following error.
Uncaught Error: Mismatched anonymous define() module: function ( $ ) {
factory( $, root, doc );
return $.mobile;
}
I also followed this post.
Separating jQuery Mobile (1.1.0) from AMD (RequireJS)
Here is a working example. It includes Requirejs, jQueryMobile, Backbone, and Marinonette.
In the index.html file, you need to specify the main module for requirejs to load.
<script type="text/javascript" data-main="js/main" src="js/libs/require-2.1.2.min.js"></script>
In this example, the main module is under "js/main.js"
Inside, main.js, you specify the require.config and use define to load your modules.

How to use Ruby on Rails 3.2 with 'yui 3.5'?

I'm writing write my first RoR application with YUI framework. I tried googling for ror+yui manuals with no success. So I went to YUI site. YUI says:
// Put the YUI seed file on your page.
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
Where it's supposed to be putted in RoR app?
I've tried to app/assert/javascripts/yui-min.js.
As a result i got <html class="yui3-js-enabled"> in every page. Supposing YUI is working now i've tried to copy-paste "Work with the DOM" example from YUI's page to app/public/index.html.
The error I received was:
Uncaught ReferenceError: YUI is not defined.
I tried the info in this link and it was not helpful to me:
https://stackoverflow.com/questions/1452829/tutorial-suggestions-on-yui-with-ruby-on-rails
Your first step in any rails app is to delete app/public/index.html ... then work in your pages inside of rails.
So that means create an app/views/layouts/application.html, and that's where you add your
<html>
<head>
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
Based on the link, you might not have it in your <head> and it needs to be.
UPDATE: (sample javascript code to change h1)
<script>
YUI().use('node', function (Y) {
var headerElement = Y.one('h1');
headerElement.setHTML("I have been updated");
});
</script>

Jquery ui.accordion error

I have a featured content slider on my homepage here: etiquetteplus.net
That slider loads fine in old versions of IE and FF. But new versions and with chrome it doesnt.
I get theses errors, but I am not sure what they mean.
ui.core.js:179Uncaught TypeError: Cannot read property ':' of undefined
Uncaught TypeError: Cannot read property ':' of undefined
Uncaught TypeError: Object function (E,F){return new o.fn.init(E,F)} has no method 'widget'
I have tried newer versions of jquery but that didnt help either. Any suggestions? Thanks!
there seems to be allot going on here but the most important thing I see off hand is on line 41 of your source code you include jquery and colorbox like so
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
<script type="text/javascript" src="http://www.etiquetteplus.net/wp-content/themes/etiquette/js/jquery.colorbox.js"></script>
then on line 86 you load a really really really old versions of jquery
<script type='text/javascript' src='http://www.etiquetteplus.net/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
<script type='text/javascript' src='http://www.etiquetteplus.net/wp-content/plugins/wp-faq/js/wp-faq.js?ver=2.9.2'></script>
<script type='text/javascript' src='http://www.etiquetteplus.net/wp-content/plugins/wp-faq/js/jquery/ui.core.js?ver=2.9.2'></script>
<script type='text/javascript' src='http://www.etiquetteplus.net/wp-content/plugins/wp-faq/js/jquery/ui.accordion.js?ver=2.9.2'></script>
i also see this error
Error: Error calling method on NPObject!
Source File: http://www.etiquetteplus.net/wp-content/themes/etiquette/js/sifr.js
Line: 17
in ff error console
then on your html is not valid
on line 210 you have a closing
</a>
tag with no open you spans a span without close etc...
you need to make sure you are using only one version of jquery and you need to validate your html
i use web devloper addon in firefox to help trouble shoot there are all kinds of cool things to help you get a good working site in order. ff only has a built in error console that will help as well
I am sure that there are more problems that what I have shown here. but if you do diligence and comb your code and html with a fine tooth comb you will get it working correctly. If you get stuck post another question (not duplicate of course) and someone will help.
good luck
mcgrailm

Resources