Failed to Load Resource In Production but Not Locally - javascript

I am working on a Django project and I have it deployed on pythonanywhere.com. In my project, I am using Django Jsignature which works fine on my local machine. In production, however, when I load the particular template, I get this error in my console - 'myurl' portion is not the real url.
https://myurl.com/static/js/jSignature.min.js net::ERR_ABORTED 404 (Not Found)```
So I don't get this locally, but do in Production. Can anyone suggest for me where to start on this? I'm not even really sure where to begin, it's my first time deploying anything.
EDIT
you can see the details of django jsignature here: https://pypi.org/project/django-jsignature/
the {{form.media}} should load this script.
UPDATE 2
This is no longer working locally either. Here are the error in my console.
Uncaught SyntaxError: Invalid or unexpected token jSignature.min.js:70
Uncaught TypeError:
$(...).jSignature is not a function

Related

facing windows script host error whenever i create and start a .js file

This error is showing for me whenever I create a new .js file example: teams.js
this is the error that appears :
Script: C:\**\**\Desktop\foot\teams.js Line: 1 Charact : 1 Error: Syntax error Code: 800A03EA Source: Microsoft JScript compilation error
Everything was normal and working perfectly.
As usual, I turned off my pc and the error appeared the next day.
On the first day, the error was saying that **windows do not have the appropriate authorization for accessing file /path **
I looked for it on the internet, and I found a solution that says to uninstall adobe Flashplayer and reinstall it, I did so but the error remains.

Magento 2 cms backend javascript error Uncaught SyntaxError: Invalid or unexpected token

Suddenly I am having javascript error and cannot edit any cms page (cms/page/edit/page_id/45) or block. I have been trying to solve this for the past week with no success. I have also tried removing the modules that I have installed recently.
I did not touch any core files and I have updated file permissions but still get this error below in chrome console from the core static files
VM6148:68 Uncaught SyntaxError: Invalid or unexpected token
at template (template.js:79:36)
at render (template.js:140:24)
at iterate (template.js:236:33)
at Function._.each._.forEach (underscore.js:150:9)
at Object.template (template.js:206:15)
at UiClass.initConfig (class.js:89:28)
at UiClass._super (wrapper.js:106:35)
at UiClass.initConfig (abstract.js:123:18)
at UiClass.initConfig (wrapper.js:109:34)
at UiClass._super (wrapper.js:106:35)
Image showing spinner and javascript error
In my case, it was a database issue due to js injection. Patching a 3rd party extension fixed the issue.

Registering Serviceworker in Laravel

I'm using pushpad (from pushpad.xyz) and followed the 3 initial steps to setup this SDK with my Laravel 5.5 Project.
But as soon as I visit a test view it just cannot find and register the Serviceworker.js
i tried placing it all over the place, almost in every folder now. So i know this is vaguely described but if you take a quick look at the Docs from pushpad you know what I mean.
Moreover, when i manually try to open it i get a 404.
also getting 404 when i try to import it via from the https:// link where its located
when i copy its content and use it in a script tag i also get a 404.
im quite clueless as how to proceed
A bad HTTP response code (404) was received when fetching the script.
Failed to load resource: net::ERR_INVALID_RESPONSE
push-test:1 Uncaught (in promise) TypeError: Failed to register a
ServiceWorker: A bad HTTP response code (404) was received when fetching the
script.
You need to make sure that you have a service-worker.js file in the root directory of your website.
You can verify the installation by typing https://example.com/service-worker.js in your browser.

Using axios-cookiejar-support with Vue.js on the backend

Has anyone used axios-cookiejar-support with Vue.js on the backend?
I'm getting the following error in the Chrome debugger:
Uncaught (in promise) TypeError: axiosCookieJarSupport is not a function
And when I console.log(axiosCookieJarSupport) I see "undefined" when I run the the init code shown on the axios-cookiejar-support site that modifies Axios to support cookies:
const axiosCookieJarSupport = require('axios-cookiejar-support').default;
axiosCookieJarSupport(axios); // <--- error occurs here
Obviously, I tried it with a Node.js console application and it works, and I can console.log axiosCookieJarSupport and I see that it is a function in the console application.
I'm guessing I need to somehow tell Webpack (which I believe Vue.js uses) to preload axios-cookiejar-support, as opposed to just include it in the package.json (which I did), but I'm not sure how to do it.

Configuring Sentry with React JS

I am trying to integrate Sentry error reporting with my react app. I have it working with my backend fine, but I am now having issues with the frontend.
What I have found is that if I run the Raven.configure("sdn").install() from my webrowser console, the error logging will work.
I have added the the script & configure to my index.html, but it will not log errors without my manually configuring in the browser console.
Thanks

Categories