parceljs not bundling axios properly - parceljs

parcel build command doesn't seem to add the Axios library properly, though it seems to be working fine in start script in npm (parcel src/index.html).
Link to the issue ..

Related

React Native, Express, Node, MongoDB stack

I am currently working on my first react-native application. I have some starter code from MERN stack projects that I have previously worked on, and in those projects, linking the frontend and backend wasn’t an issue. I am using redux for its reducers and actions to try to send data to my mongodb database. In my redux actions, I am using axios for API calls, but none of them work.
https://levelup.gitconnected.com/mernn-to-do-app-dab1e3173493
I also tried running the server and the expo app at the same time (like in the link above), but it is not working. Sometimes, the server side will coincide with the client side and result in the error Error: listen EADDRINUSE: address already in use :::5000.
Does anyone know an easy way to set up an express, node, and mongodb backend to a react-native app?
BEFORE: Run npm start in the terminal and check the output to see if the terminal print something like server.js nodemon src/server.js.
REASON: If you do then your scripts are calling server.js twice, which is causing this Error.
FIX: I had the same issue and fixed it by fixing my package.json in root folder and also the package.json in the server folder.
AFTER: you should see the terminal print nodemon src/server.js when you run your script.
Hope this helps.

React Native Error Advice - The development server returned response error code:500

I am using React Native and encountered the following error on my android emulator
I am new to React Native and was coding in App.js. I watched a tutorial online on how to use react-navigation so I was following it and created a homestack.js file. My app.js file was still working perfectly fine at this point.
I added code to homestack.js and then imported it to my app.js file but that's when this error popped up. This error was not resolved when I commented out all of the code on homestack.js nor when I commented out the import on my app.js file.
I followed the instructions on the error (clear watchman, delete node modules, yarn install, yarn reset cache) but this also did not resolve the issue.
The fix:
Since none of the above fixed the issue, I removed the homestack.js file from my root folder completely which then fixed the issue. What I did not expect however was that when I put the homestack.js file back into the root folder to see what would happen, the app ran again fine with no issues. It was as if the error never happened.
I guess my question is, what was the actual issue here? Why did taking the file out of the folder and then placing it back in fix the issue? I ran 'npx react-native run-android' after every step of the above fix process so the issue was not because the emulator was running an old version.
Following this error, You have imported react-navigation-stack without install the package. You can install the packge
yarn add react-navigation-stack #react-native-community/masked-view react-native-safe-area-context
or
npm install react-navigation-stack #react-native-community/masked-view react-native-safe-area-context
To know more https://www.npmjs.com/package/react-navigation-stack
After install the package clean project by executing command cd android && gradlew clean, then debug your project.

example using beforeMiddleware & webpackBlocker in a karma.config.js file

i've got a karma-webpack2-qunit setup with babel loader working. es6 is used for both src and test js files.
when running karma in autowatch mode, any changes to source files are detected and karma re-runs the test suite again but the changes are not picked up.
based on this note from the webpack-karma integration page: webpack-karma middleware info , this seems like the config option i need to get the setup fully working.
"This loader provides a webpackBlocker middleware that will block tests from running until code recompiles."
i can't find any examples of using the webpackBlocker configuration.
does someone have a working config they can share?
here's what i'm using in karma.config.js:
the karma test suite is working still but code changes to source or test code do not get reflected in the next run.
i finally got this working. had a mismatch in my "files" pattern config for my test and source files including the "context" object.
now when i modify either test or source js files, the code is compiled first and the tests are rerun in autowatch mode. yay !!!
will post the full working solution to a GitHub repo in case anybody else wants to get the same "unholy" :-) combination (karma + qunit + webpack + es6 + mocha reporter + phantomjs) working. will also add linting.

Trouble debugging protractor in IntelliJ

I had my setup working just fine a month or so ago in my project for debugging my protractor scripts in IntelliJ.
However, since the project upgraded to Angular 2 release and Protractor 4.0.9, I have been unable get the debugging to work.
The error I'm getting is:
Error message: No selenium server jar found at the specified location (./node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar). Check that the version number is up to date.
So, realizing that maybe I forgot to run webdriver-manager update. And while it appeared like selenium got updated, it did not get updated in my project's node_modules folder (referenced above).
Thinking there may be something wrong, which sometimes happens, I nuked the node_modules folder, ran npm install, ran webdriver-manager update, and... I still have the same problem.
My Run/Debug Configurations item for my test is as follows:
Node interpretor: /usr/local/bin/node
Node parameters: --harmony
Working directory: [my project folder's root]
JavaScript file: node_modules/protractor/built/cli.js
Application parameters: test/e2e/myTestFile.conf.js
Environment variables: [none needed for this test]
Before launch: [blank]
Node is 6.5.0
Angular 2.0.0
protractor 4.0.9
And, fwiw, typescript 2.0.2
(Both the angular project and the protractor code are in typescript.)
Now, I am able to run my tests from the command line. But being able to step through code to find my errors, or be able to pause with access to my objects, which I can't do when I do a browser.pause().

Can someone explain how SystemJS works?

I just want to know how SystemJS works. My idea is that it executes modules transpiled for it, but I really don't know how it gets a System.import-ed module executed.
For instance, I have my Angular2 app transpiled with Gulp and Typescript to a bundle and load it via SystemJS. The app is loaded perfectly: I get no console errors in my browser, but the application doesn't start.
Do I need special prerequisites for transpiling and running Typescript code?