Graphql TS1208 "Cannot compile namespaces when the isolateModules flag is provided - reactjs

I'm learning graphql and installed the library npm install graphql --save, which worked. However, when trying out the code for the server, the keyword Query seems to be having an issue, it's telling me I need a comma. Any advice is appreciated.

My first problem was not making sure the code within buildSchema was a string. After realizing that...
TS1208 "Cannot compile namespaces when the isolateModules flag is provided.
isolateModules is a TSConfig.json option.
If you run this code with 'node server.js' it works.
The error is misleading and doesn't appear to affect anything.

Related

React server won't start after installing styled-components

Disclaimer: this is my first question on Stack Overflow, so apologies if it's not formatted correctly. Please let me know how I can improve it or if more details are needed.
I tried to install styled-components for my React app with the following command npm install --save styled-components.
Before I did this, my server started up just fine with npm start.
After install, React tries to start up the development server but it stops and returns the following errors:
cacheEntry.sizeOnlySource = new SizeOnlySource(size);
TypeError: SizeOnlySource is not a constructor
at updateFileWithReplacementSource (project-directory/node_modules/webpack/lib/Compiler.js:756:37)
at updateWithReplacementSource (project-directory/node_modules/webpack/lib/Compiler.js:738:8)
at processMissingFile (project-directory/node_modules/webpack/lib/Compiler.js:801:8)
at project-directory/node_modules/webpack/lib/Compiler.js:843:10
at Immediate.<anonymous> (project-directory/node_modules/memfs/lib/volume.js:698:17)
Initially, I tried uninstalling the styled-components package. Same errors. Then, I tried updating webpack with npm update webpack.
I googled the errors but they were all for problems that seemed unrelated or that are now fixed.
Support Webpack 4.29.0 breaking change
output.futureEmitAssets option breaks compatibility with source map upload plugins
library target umd - Uncaught TypeError: x is not a constructor
I did come across a post on Stack Overflow explaining that --save is no longer necessary as of npm version 5.0.0. Perhaps it's the source of the error?
Note that I installed the styled-components package on a separate branch of my project, but the server still won't start when I switch to the main branch and I'm getting the same errors.
Honestly, I have no idea what's going wrong or how to fix it. Any help or guidance would be greatly appreciated.
Edit: before the Starting development server... line I get after running npm start, there's some kind of message about webpack being deprecated. I hadn't noticed that before, but it flashes by too quickly for me to read it and I can't scroll up to see the message. I created a new React project from scratch to see if the server would start. It does, but I'm still getting the aforementioned messages.

Stripe API: Module not found: Can't resolve '#stripe/react-stripe.js'

Do I have a simple typo? Do I need to install anything else? I'm getting the following error message:
"Module not found: Can't resolve '#stripe/react-stripe.js'"
I have also npm installed: #stripe/react-stripe-js #stripe/stripe-js
Appreciate any help figuring this out!
Below are screenshots for reference:
import ... from '#stripe/react-stripe-js'
You are importing it in the wrong way. #stripe/react-stripe.js is not correct. Just replace . with -, it should work then.
As you can see in the its document. You need to import its component from #stripe/react-stripe-js
stripe-js correct import statement
Stripe API ReactJS Error
“Module not found: Can’t resolve ‘#stripe/react-stripe.js’”
npm install #stripe/react-stripe-js#1.11.0
‘#stripe/react-stripe-js’ or ‘#react-stripe-js’
When I read the official Stripe docs, everything looked simple. However, I stuck at the first step for an hour.
The issue was a
Error: module not found: can’t resolve ‘#stripe/react-stripe-js’
It is a very simple error that occurs when we miss modules. But I definitely installed and followed the official manual like the below picture. It was very weird so I started to install another one but didn’t work.
So how do you fix it?
First, open your ” package.json” and take a look at
if your package is okay, it supposed to look like this below
#stripe/react-stripe-js”: “1.4.1”,
“#stripe/stripe-js”: “1.15.0”,
the Left side should be the package name and the right side is a version of the package. But when I opened up
“#stripe/stripe-js”:“github:stripe/stripe-js”
#stripe/react-stripe-js”:“github:stripe/stripe-js”
So I reinstalled it like this, added a specific version of the package instead of copying it from Strip docs.
Try like this (Answers)
npm install #stripe/react-stripe-js#1.1.2
npm install #stripe/react-stripe-js#1.11.0
And It solved easily. I am not sure why this issue happened. If I find the reasons, I will add them or if you know the reasons please let me know.

I cannot find what the problem is about create-react-app

all of sudden, I encountered something I cannot handle
when I do "create-react-app" and want to compile something,
it takes too.... much time to compile
most weirdly, it is only occurred when I change "components"
like typing "too slow " and after save it,
compiling takes too much time.
changing css is not the case of it. it is immediately complied and applied
only components changing has problem of compile speed.
I tried html file with live server, but it is compiled very fast.
so I think create-react-app has something wrong but I cannot understand of it
+
recently when I use "npx create-react-app . --template typescript" ,
when I do "npm run start" it changes tsconfig and makes lots of error about
"jsx" system
what's wrong with it. can anyone help me about my problem?
I assume you are having the problem of VSCode warns about the --jsx flag inside the tsconfig.json, that can be seen here.
You can fix like in here.
P.S: It would be very cool if the next time asking questions, you could format and proofread so that what you write is easier to understand.

CamanJS with React

I'm trying to use CamanJS with React, I'm installing as a node module with npm install caman per the documentation but I am getting an error. I've tried using require to bring it in, I've also tried import. The package is in my node_modules folder.
Heres the error:
Console Warning:
Any help is very much appreciated!
Yeah, the issue is that fibers is looking for environment variables, but because you're running it in the browser, it can't find them. npm i -s caman is meant to be used with node. Kinda a bummer.

TypeScript errors while referencing Angular2 in Gulp

The problem is
[11:16:06] TypeScript: 103 semantic errors
[11:16:06] TypeScript: emit succeeded (with errors)
I am using node v5.7.0 and npm 3.6.0
gulp -v:
[11:26:58] Requiring external module babel-register
[11:26:58] CLI version 3.9.1
[11:26:58] Local version 3.9.1
I am total begginer with babel on gulp.
I generated the files under ubuntu 15.10 with yo 1.6.0 using
generator-modern-web-dev in fresh folder.
The errors are like
app/test/sanity_test.spec.ts(2,1): error TS2304: Cannot find name 'describe'.
app/test/sanity_test.spec.ts(3,2): error TS2304: Cannot find name 'it'.
app/test/sanity_test.spec.ts(4,3): error TS2304: Cannot find name 'expect'.
app/test/sanity_test.spec.ts(7,2): error TS2304: Cannot find name 'xit'.
app/test/sanity_test.spec.ts(8,3): error TS2304: Cannot find name 'expect'.
/home/danielduel/Pulpit/server/node_modules/angular2/platform/browser.d.ts(77,90): error TS2304: Cannot find name 'Promise'.
then... more errors. (I can post it, if it is very critical to see all the 103 errors)
I was reinstaling sudo npm install npm_modules with success, but it was not fixed what I aam dealing with.
Then, task "scripts-javascript-dist" from
[11:16:09] 'scripts-javascript-dist' errored after 3.31 s
[11:16:09] Error: Error on fetch for npm:angular2#2.0.0-beta.7/bootstrap.js at file:///home/danielduel/Pulpit/server/jspm_packages/npm/angular2#2.0.0-beta.7/bootstrap.js
Can you lead me to fix this problems?
I can add source codes of tasks, but they are done over abstract ES2015 architecture and it depends on many files, but if its needed - give me the info.
StackOverflow threads that I was trying and looks at least fammiliar:
module not found angular, generates more errors
this one looks good, but I do not understand at all
this one, with config is not working as fix, generates more errors
I think, I am missing something, but I can't recognize what.
You should never need to sudo npm install locally!
From the errors you presented, it looks to me as if the project doesn't have all required type definitions, especially these for the test code. This could be caused by some invalid project setup or by incorrect references inside the included modules.
Please check if you have tsd or typings in your project and install the missing type definitions for (I assume) jasmine.
https://github.com/typings/typings (new)
http://definitelytyped.org/tsd/ (deprecated)
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jasmine/jasmine.d.ts
It's hard to say if this is the solution in your case, but I hope this helps you tracking down the root cause.

Resources