I have created a simple application using Create-React-App (CRA). The problem is that even though the app runs perfectly fine on my localhost (ie, after using npm start), when I try to publish my pages to gh-pages (npm run build, and npm run deploy), I am not able to load the page using the URL. I don't even see any errors in console at first, but after a while (or more specifically, after I open the Timeline tab in console), I see the following error.
Failed to create temp file 18 : It was determined that certain files
are unsafe for access within a Web application, or that too many calls
are being made on file resources.
I do see this warning on my local dev environment,
[Violation] Long running JavaScript task took 229ms
and the minified bundle.js file goes to about 4MB in size. But I guess this is not the issue because my other projects have the same warning and they are published just fine.
I'm also fairly confident that this is a more JavaScript related issue, rather than CRA related. I read somewhere that this might be a network mapping of resources issue. But so far, I'm not really sure what this means or how to resolve it.
Just to answer my own question, in case anybody else lands up here.
The issue was in the way I was using react-router. I was initially using browserHistory instead of hashHistory.
As per the docs,
GitHub Pages doesn’t support routers that use the HTML5 pushState
history API under the hood (for example, React Router using
browserHistory). This is because when there is a fresh page load for a
url like http://user.github.io/todomvc/todos/42, where /todos/42 is a
frontend route, the GitHub Pages server returns 404 because it knows
nothing of /todos/42.
More information can be found here.
Related
So after playing with Expo for a bit I've decided that I'd rather develop with the option for native features if needed.
I've followed all the steps here: https://reactnative.dev/docs/environment-setup and double checked them.
I ran npx react-native init <myprojectname> which was create successfully. I've then copied my minimal existing code to my new project, and now I can't run the app. I was able to run my code when it was on expo, and I was able to run the initial native setup before copying my code.
The issue doesn't seem to be related to the code itself though. Maybe some configuration?
It says it is Unable to resolve module.. and that None of these files exist.
These files most definitely exist.
I've tried cleaning the app's cache from my phone. Completely deleting it and reinstalling.
I've tried renaming my screen name from HomeScreen.tsx to HomeScreen.native.tsx.
Nothing seems to work. What is the issue here?
This is the error screen
And this is my files structure:
I'm building a desktop application using Python, JS, HTML and CSS. I'm connecting python using eel. When I launch my desktop application through the python terminal, it works perfectly.
However, when I launch the app through electron via command line:
$npm start
The desktop application loads up, but it doesn't execute on any of the python backend, explained well by this error in the inspector:
Failed to load resource: net::ERR_FILE_NOT_FOUND eel.js:1
I'm not sure what is causing it, I have spent the last 8 hours testing things but to no avail.
I know you may need more information but I've been checking everything, from file structure i.e. the __.py outside web folder, to inserting <script type="text/javascript" src="/eel.js"></script>, so please comment below what specifically you require as including every possible cause would be a very huge question. I will include whatever is relevant in edits in this question alongside the final answer for anyone with similar issues in the future.
No need to run from npm. eel.js is just virtual javascript, dont bother with it.
Put this in your your_main.py file
import eel.browsers
asign your electron browser
eel.browsers.set_path('electron', 'node_modules/electron/dist/electron')
and then use it
eel.start('main.html', mode='electron')
to run, call from python:
python your_main.py
We have a React app built with Create React App with Typescript and webpack 3 with split chunks. Our app is used in our clients' websites - they load it into their website with a script tag, and then launch it. When our app is launched, it appends a new element to the body, and renders itself into it.
This solution has worked perfectly thus far, but we now have a new client who is experiencing some kind of clash between their bundle and ours upon integration of our module into their website.
The specific error we're seeing is this: Uncaught (in promise) TypeError: Cannot read property 'createElementNS' of undefined. This error is coming from the first chunk. I think this is happening because only the first chunk is loaded, not the subsequent one/s, which in turns is probably happening due to a clash between the bundles.
I added the following to our config in an attempt to fix this problem:
output: {
// ...
jsonpFunction: 'wpJsonpChargeAfter',
}
But the bug still persists.
I'm starting to think maybe I need to change something in the libraryTarget to prevent the clash. Possibly set it to umd?
So the main question here is: what do I need to change in the webpack config to allow a webpack bundle to run within another web app without any clashes?
Any help would be appreciated.
I've googled around for an answer but have yet to turn up anything of use. Does anyone know why attempts to run ember test at best result in a message that reads:
Built project successfully. Stored in "/Users/.../tmp/class-tests_dist-H42JePnK.tmp".
If your tests won't run at all, here are a few things to look for:
Check for a testem.js file. It is essential and contains the instructions and configurations that the Ember CLI needs. Deleting it will cause your app to build and 0 tests to run.
Check to make sure your testem.js file is valid/complete. You can test this by doing ember init and then choosing option d (diff) to see what is different between your app and a brand new app.
Your tests are also available in the normal browser. Go to http://localhost:4200/tests and see what happens there. Perhaps it will give some clues.
Similar to above, try ember test --server and see if you get different results.
Create a fresh app with ember new and try doing ember test. It can sometimes be easier to compare a fresh app instead of doing the ember init diffing.
Try switching the browser you are using for testing (unlikely to be the problem in this case, but sometimes works). For example, run the tests with headless Chrome instead of PhantomJS. The most recent release of the Ember ClI has the testem configuration that you need to try headless Chrome.
I am eager to try out the new ManifoldJS that Microsoft announced at Build 2015, but I am struggling. I have put up a basic site on http://powertalks.azurewebsites.net/. It is a HTML- and JS- app using Angular and TypeScript. I have also published a manifest.json file, so all should be good to go.
When I try to generate a package online from: http://www.manifoldjs.com/generator, it says it is generating, but nothing happens. Looking at the dev tools, I see that an 500 Internal Server Error pops up. Trying the command line yields no results either. It starts to generate the packages, but returns with a new error:
"Command failed: 'C:\Users\FirstName' is not recognized as an internal or external command".
I should point out that my manifoldjs file is installed on 'C:\Users\FirstName LastName\AppData\Roaming\npm\node_modules\manifoldjs', so might be something to do with the space in the path?
The issue has been addressed (https://github.com/manifoldjs/ManifoldJS/issues/57) and the fix will be available in version v0.2.1.