How can I get my .env file to working properly - file

I have been trying to run the node create.js to get the data table but the terminal returns error code: Missing_auth_field, Missing fields in token context. I had tried several methods to debug it like checking my .env file and seeing that the logo of the .env file appears to be a cog-wheel, not the paper logo. I assume that the error occurred because my .env file is not working properly, can anyone tell me if my assumption is right or not?

Related

Stripe Checkout is missing the required `key` parameter in React

I'm integrating Stripe checkout with my project(React), but when I proceed with the payment, I get this error stating "key" is missing. I can't really figure out what am I missing here. I'm following the react stripe checkout documentation at https://www.npmjs.com/package/react-stripe-checkout
My .env file has :
REACT_APP_STRIPE='myPublishable key'
You should put the private key in api env file
Make sure your .env file is in the root.
Variable name should start with "REACT_APP_"
While writing the value to the variable don't give space like
REACT_APP_KEY =pk_key....
Stop the react npm server and restart it to let the server know about the .env file.

importing Amplify throws error "null is not an object (evaluating 'keys.filter)" in react native app

Any time I import Amplify into my React Native project's App.js file, I get the following error:
TypeError: null is not an object (evaluating 'keys.filter')
Here is how I'm importing it:
I run the project using Expo only. If I comment the import Amplify line out, any other files which use anything related to Amplify cause the same error to occur.
Initially, when I was loading this project for the first time, I had other errors to deal with like first needing to create the aws-exports.js file. I copied this over from an old project (Because this is meant to be a re-do of another project that's already set up). Once I included that file I had to update a few lines in that file because of an improper reference to Linking from expo. Once I fixed that, it throw this error I'm referencing here. Now, even if I delete the aws-exports file it will throw this error as soon as Amplify is imported into the App.js file.
-- Update
I've found where the error is occurring. Some of my code gets executed but the error happens inside of the reactnative.js file when syncing between two memory software.
I've tried to reproduce this error inside a fresh react application by copying the package.js file and then importing Amplify into the App.js file but it doesn't throw this error.
Here is a screenshot of where the error is taking place. I'm still trying to figure out how to pinpoint where in my code this error begins.
According to Expo, you have to follow these steps
it would be best if you imported Amplify
import Amplify from '#aws-amplify/core'
All you need to follow those steps it sees the configuration issue result data is not coming that's why it gives a null value and crashes.
Follow steps below will fix your problem
https://blog.expo.dev/how-to-build-cloud-powered-mobile-apps-with-expo-aws-amplify-2fddc898f9a2
The problem seems to be resolved by changing the slug attribute in the react app.json file. I changed the slug from being a camel case to an all lower case slug.
After this the error has gone away for what seems permanent. I've been able to replicate the error in small sample apps. I don't understand why this causes these errors.

Failed to compile react project

I am doing a React project and I am redesigning and optimizing the code. The thing is I had in layout a file named "Footer.js". I want to erase it, but when I erase it or I change the name, the project doesnt compile and it appears on screen
Error: ENOENT: no such file or directory, open + name of the directory"
I thought thay maybe it was because of an import of other file of the footer.js file, but I have checked and the routes have been automatically updated. So, any idea about how could I fix it? Thanks, regards.
Search-all through your project directory for just "footer" - something is probably importing it that you haven't spotted.

How to test a particular jsx file within localhost?

Below is the screenshot of my working directory.
I run yarn dev command to start local host to test my site. After the local host is set up I could test every jsx file which is under pages folder by going to their respective link. Like if I want to test campaigns.jsx file I go to http://localhost:3000/campaigns and everything works file and even for any other jsx file under pages folder everything works fine.
But similarly if I want to test jsx files within components folder and go to their respective link like http://localhost:3000/topnav, I get 404 | This page could not be found. error message.
So could anyone tell me is there any possible way to test jsx files which are under components folder as I'm new to this REACT world.

A method named '/parties/insert' is already defined angular-meteor tutorials

I am new to meteor + angular and i am learning this from http://www.angular-meteor.com/
When i reach 3-way data binding section and create folder called collections in socially folder and create file called parties.ts it is giving me error i write following two lines in that file.
import {Mongo} from 'meteor/mongo';
export let Parties = new Mongo.Collection('parties');
here is the error log.
C:\<user>\AppData\Local\.meteor\packages\meteor-tool\1.3.2_4\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
throw(ex);
^
Error: A method named '/parties/insert' is already defined
at packages/ddp-server/livedata_server.js:1548:15
at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
at Server.methods (packages/ddp-server/livedata_server.js:1544:7)
at packages/allow-deny/allow-deny.js:191:24
at [object Object].CollectionPrototype._defineMutationMethods (packages/allow-deny/allow-deny.js:190:5)
at new Mongo.Collection (packages/mongo/collection.js:226:8)
at meteorInstall.collections.parties.js (collections/parties.ts:2:22)
at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:141:1)
at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:75:1)
at collections/parties.ts:2:54
Exited with code: 8
Your application is crashing. Waiting for file change.
I hope i will get help from this community. Thanks.
I had the same problem and successfully fixed it. I was also using Atom with the Atom TypeScript plugin, which was automatically compiling the TypeScript files to JavaScript separate from Meteor and creating unnecessary files.
Here are the steps that I took to fix the problem:
Check your tsconfig.json file and make sure it has these lines (add or change them if necessary):
"buildOnSave": false,
"compileOnSave": false,
Close and restart Atom to make sure the Atom TypeScript plugin uses the new settings and stops automatically compiling TypeScript to JavaScript on save.
Delete all *.js and *.map files in your "client", "server", and "both" directories.
Stop your Meteor instance if it is currently running (probably "ctrl-c" or "command-c", depending on your OS).
Run "meteor reset" on the command line.
Run "meteor" on the command line to recompile your TypeScript files and restart Meteor.
After that, everything worked fine for me.
Problem could be sometime type script might not be compiled properly into js. Try deleting js file in that folder , edit your typescript file and save. Next recompilation should remove this error.
I have the same error. Did you ever figure it out?
I ended up solving my issue and I had to add "compileOnSave": false" to my tsconfig file. I'm using Atom and it was automatically compiling.

Resources