I am afraid that I can't post code, as there is too much of, but am hoping that someone will recognize my problem.
I have an existing, working app, which I want to use as the basis for a new one.
So, I copied all of localhost/<some directory>/App1 to localhost/<some directory>/App2, but when I try to load the app, I get Uncaught ReferenceError: angular is not defined(…)
I just don't understand it. I have copied the entire directory and changed nothing. The first app still works fine, but the copy gives that error.
Any idea what I am doing wrongly?
Related
I have browsed many possible solutions to this error with no success. I understand the fundamental issue is that the request to /static/js/main.[hash].js is expecting JS, and instead is returning HTML. I can not, however, understand why the application runs fine while using a Private window, and also will work ONE time after clearing cache and hard reload. In addition to the error message, we get a white screen and the app does not load.
Looking at the Network tab in the browser, I compared the request when working and when not working. I noticed that when working, i.e. in private window, it seems as though the HTML is fetched using a different endpoint, /null. The response is the same HTML that causes the error (the app HTML), but for some reason it works here.
It seems as though the error could be fixed if I could define the request to accept HTML or JSX, but I don't know where to find where this request is called as it seems as though this is all handled by Webpack.
One thing to note, is that when running yarn build and serving the build locally, we still get the error message, but the app does load (no white screen). In the local build HTML, we find a script tag like this:
<script src="undefined"></script>
While the production (breaking) build gives us this:
<script type="text/javascript" src="/static/js/main.ff34f559.js"></script>
edit: The project was created using CRA then freshly ejected
Any help is greatly appreciated!
I am starting to help someone with a new project. This project is React (React Native as is a mobile app).
The project is working fine on her laptop (in her browser), and when I scan the Expo QR code, the app works fine on my Android device.
However, trying to run it in my browser is throwing all these errors:
The 'Can't resolve' error doesn't make sense, because the correct react native files are there. Is this a cache problem? I have tried deleting the .expo/web/cache folder and starting over.
Also, why are there multiple errors in my console, but only one being shown in the information on the actual web page? Does this mean that the single error being shown is causing all the other errors, or it is the only one which needs fixing, or will it show the next error when I fix the one that is being shown?
Thanks
Seems to have been a known problem re babel. See the links below:
https://github.com/babel/babel-loader/issues/173
how to solve this error You may need an appropriate loader to handle this file type
So I have yet another problem with my home application. I am trying to get a live preview image directly on my html page. I am using VS Community and I linked to https://github.com/mbppower/CordovaCameraPreview.git to download the right repository. VS then tells me I have downloaded it. However, when I try to plug the line:
cordova.plugins.camerapreview.startCamera(rect, "front", tapEnabled, dragEnabled, toBack)
I get back an error in my javascript which reads as follows:
Cannot read property 'camerapreview' of undefined
I am following the orders of the github post to the letter but I am still getting an error. Any help in solving this problem will be greatly appreciated!
The error message
Cannot read property 'camerapreview' of undefined
tells you that in this statement:
cordova.plugins.camerapreview.startCamera(rect, ...
cordova.plugins is not defined - that's where you need to look.
Not sure if somebody ever experiencing this.
I use Rollbar for collecting error from front-end React project.
But i got some strange error like...
132 TypeError: undefined is not an object (evaluating 'document.getElementsByName('emailconfirm_1')[0].value = ''')
the strange part is that, i don't have any of emailconfirm object in my code at all.
i grep this name to my whole project directory, including built assets, but can't find any...
Can somebody think of the possibility that could make this happen? it's just looks so weird to me.
I'm trying to build an application with Angular but I've run into an error that I'm unsure how to resolve. It seems to have something to do with the routing that I have set up.
As soon as the page loads it is forced by the routing to go to the first view, which is what I want it to do, but it is throwing a weird error...
Error: [ng:areq] http://errors.angularjs.org/1.2.19/ng/areq?p0=LoginController&p1=not%20aNaNunction%2C%20got%20undefined
at Error (native)
The best way I could get your hands on my code is to load it into GitHub. You can find my repository here...
https://github.com/JosephEricDavis/TimeTrack
It's pretty simple and strait forward so far. Not a lot of code to dig through yet. Can anybody see what I'm doing wrong?
Thanks
Well, that's pretty embarrassing. As miqid mentioned in the comment, I had forgotten to include script tag references to my controller files.