Git Product home page Git Product logo

asp.net-core-5-and-react-second-edition's People

Contributors

carlrip avatar deepesh-packt avatar mohammedyusufimaratwale avatar packt-itservice avatar packtutkarshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asp.net-core-5-and-react-second-edition's Issues

I have problem when authorized users post questions and press ask question button i get error

Unhandled Rejection (Error): Objects are not valid as a React child (found: object with keys {map, forEach, count, toArray, only}). If you meant to render a collection of children, use an array instead.
โ–ถ 17 stack frames were collapsed.
initAuth0
E:/core_project/E_projects/dot5/react/QandA/frontend/src/Auth.tsx:50
47 | const user = await auth0FromHook.getUser();
48 | setUser(user);
49 | }

50 | setIsAuthenticated(isAuthenticatedFromHook);
| ^ 51 | setLoading(false);
52 | };
53 | initAuth0();

Chapter 12 don't use Redux anymore, help!

Hi, i developed my own project throughout the book, and now i have the problem that i don't know how to merge the code that do not use Redux with my project that does. In chapter 12, in "Aborting data fetching", can you show how to solve that using Redux? Thanks in advance!

In chapter 7 Creating the store

in step 2 when use combineReducer function i have got an error and i don't know what's wrong please help this error message

No overload matches this call.
Overload 1 of 3, '(reducers: ReducersMapObject<Appstate, any>): Reducer<CombinedState, AnyAction>', gave the following error.
Type '(state: QuestionState | undefined, action: QuestionActions) => QuestionState | { unanswered: QuestionData[]; loading: boolean; unawnsered: QuestionData[]; viewing: QuestionData | null; searched: QuestionData[]; } | { ...; }' is not assignable to type 'Reducer<QuestionState, any>'.
Type 'QuestionState | { unanswered: QuestionData[]; loading: boolean; unawnsered: QuestionData[]; viewing: QuestionData | null; searched: QuestionData[]; } | { ...; }' is not assignable to type 'QuestionState'.
Type '{ viewing: QuestionData | undefined; loading: boolean; unawnsered: QuestionData[]; searched: QuestionData[]; }' is not assignable to type 'QuestionState'.
Types of property 'viewing' are incompatible.
Type 'QuestionData | undefined' is not assignable to type 'QuestionData | null'.
Type 'undefined' is not assignable to type 'QuestionData | null'.
Overload 2 of 3, '(reducers: ReducersMapObject<Appstate, AnyAction>): Reducer<CombinedState, AnyAction>', gave the following error.
Type '(state: QuestionState | undefined, action: QuestionActions) => QuestionState | { unanswered: QuestionData[]; loading: boolean; unawnsered: QuestionData[]; viewing: QuestionData | null; searched: QuestionData[]; } | { ...; }' is not assignable to type 'Reducer<QuestionState, AnyAction>'.
Type 'QuestionState | { unanswered: QuestionData[]; loading: boolean; unawnsered: QuestionData[]; viewing: QuestionData | null; searched: QuestionData[]; } | { ...; }' is not assignable to type 'QuestionState'.
Type '{ viewing: QuestionData | undefined; loading: boolean; unawnsered: QuestionData[]; searched: QuestionData[]; }' is not assignable to type 'QuestionState'. TS2769
I

No user.svg for chapter 3 start

The book describes using a "user.svg" file in chapter 3 and links to the file here on page 117(kindle): link The file does not exist here. It does however exists in the finish folder instead.

Chapter-03 finish react-scripts start issue

npm install completes OK
npm start leads to following message:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Hal\Documents\Packt\ASP.NET-Core-5-and-React-Second-Edition-master fm GitHub\ASP.NET-Core-5-and-React-Second-Edition-master\chapter-03\finish\frontend\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python38\Scripts;C:\Python38;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Brackets\command;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;;C:\Program Files\Azure Data Studio\bin;C:\Program Files (x86)\dotnet;C:\Users\Hal\AppData\Local\Microsoft\WindowsApps;C:\Users\Hal.dotnet\tools;C:\Users\Hal\AppData\Local\Programs\Azure Data Studio\bin;C:\Users\Hal\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Hal\AppData\Roaming\npm;C:\Program Files (x86)\DTN\IQFeed;C:\Users\Hal\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Azure Data Studio\bin;C:\Users\Hal.dotnet\tools
9 verbose lifecycle [email protected]start: CWD: C:\Users\Hal\Documents\Packt\ASP.NET-Core-5-and-React-Second-Edition-master fm GitHub\ASP.NET-Core-5-and-React-Second-Edition-master\chapter-03\finish\frontend
10 silly lifecycle [email protected]
start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Hal\Documents\Packt\ASP.NET-Core-5-and-React-Second-Edition-master fm GitHub\ASP.NET-Core-5-and-React-Second-Edition-master\chapter-03\finish\frontend
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v12.17.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: react-scripts start
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

from terminal:
PS C:\Users\Hal\Documents\Packt\ASP.NET-Core-5-and-React-Second-Edition-master fm GitHub\ASP.NET-Core-5-and-React-Second-Edition-master\chapter-03\finish\frontend> npm start

[email protected] start C:\Users\Hal\Documents\Packt\ASP.NET-Core-5-and-React-Second-Edition-master fm GitHub\ASP.NET-Core-5-and-React-Second-Edition-master\chapter-03\finish\frontend
react-scripts start

'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

lines from package.json:

"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

lines from package-lock.json

"react-scripts": {
  "version": "4.0.1",
  "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.1.tgz",
  "integrity": "sha512-NnniMSC/wjwhcJAyPJCWtxx6CWONqgvGgV9+QXj1bwoW/JI++YF1eEf3Upf/mQ9KmP57IBdjzWs1XvnPq7qMTQ==",
  "requires": {

...

From your code while trying to ask a question this error occurs

System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'System.String'.
---> System.IO.IOException: IDX20807: Unable to retrieve document from: 'System.String'. HttpResponseMessage: 'System.Net.Http.HttpResponseMessage', HttpResponseMessage.Content: 'System.String'.
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

ref={register} errors in CH6

Multiple places ref={register} with following errors: Header.tsx. AskPage.tsx, etc.

Type 'UseFormRegister' is not assignable to type 'LegacyRef | undefined'.
Type 'UseFormRegister' is not assignable to type '(instance: HTMLInputElement | null) => void'.
Types of parameters 'name' and 'instance' are incompatible.
Type 'HTMLInputElement | null' is not assignable to type '"title" | "content"'.
Type 'null' is not assignable to type '"title" | "content"'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.