You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am using React for an application that makes calls to GitHub RESTapi using their octokit sdk.When I run the application using npm start, the application runs perfectly. Only when I use the command npm run build, I get an error related to octokit library.
C:\Users\Vaibhav\Desktop\devops-d2r> npm run build
devops-d2r@0.1.0 build
react-scripts build
Creating an optimized production build...
Failed to compile.
TypeError: C:\Users\Vaibhav\Desktop\devops-d2r\node_modules@octokit\core\dist-web\index.js: Cannot read properties of null (reading 'body')`
and when i navigate to the directory path of the error and search for the 'body' variable, I do not find any...
// pkg/dist-src/index.jsimport{getUserAgent}from"universal-user-agent";import{Collection}from"before-after-hook";import{request}from"@octokit/request";import{graphql,withCustomRequest}from"@octokit/graphql";import{createTokenAuth}from"@octokit/auth-token";// pkg/dist-src/version.jsvarVERSION="5.2.0";// pkg/dist-src/index.jsvarnoop=()=>{};varconsoleWarn=console.warn.bind(console);varconsoleError=console.error.bind(console);varuserAgentTrail=`octokit-core.js/${VERSION}${getUserAgent()}`;varOctokit=class{static{this.VERSION=VERSION;}staticdefaults(defaults){constOctokitWithDefaults=classextendsthis{constructor(...args){constoptions=args[0]||{};if(typeofdefaults==="function"){super(defaults(options));return;}super(Object.assign({},defaults,options,options.userAgent&&defaults.userAgent ? {userAgent: `${options.userAgent}${defaults.userAgent}`} : null));}};returnOctokitWithDefaults;}static{this.plugins=[];}/** * Attach a plugin (or many) to your Octokit instance. * * @example * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) */staticplugin(...newPlugins){constcurrentPlugins=this.plugins;constNewOctokit=classextendsthis{static{this.plugins=currentPlugins.concat(newPlugins.filter((plugin)=>!currentPlugins.includes(plugin)));}};returnNewOctokit;}constructor(options={}){consthook=newCollection();constrequestDefaults={baseUrl: request.endpoint.DEFAULTS.baseUrl,headers: {},request: Object.assign({},options.request,{// @ts-ignore internal usage only, no need to typehook: hook.bind(null,"request")}),mediaType: {previews: [],format: ""}};requestDefaults.headers["user-agent"]=options.userAgent ? `${options.userAgent}${userAgentTrail}` : userAgentTrail;if(options.baseUrl){requestDefaults.baseUrl=options.baseUrl;}if(options.previews){requestDefaults.mediaType.previews=options.previews;}if(options.timeZone){requestDefaults.headers["time-zone"]=options.timeZone;}this.request=request.defaults(requestDefaults);this.graphql=withCustomRequest(this.request).defaults(requestDefaults);this.log=Object.assign({debug: noop,info: noop,warn: consoleWarn,error: consoleError},options.log);this.hook=hook;if(!options.authStrategy){if(!options.auth){this.auth=async()=>({type: "unauthenticated"});}else{constauth=createTokenAuth(options.auth);hook.wrap("request",auth.hook);this.auth=auth;}}else{const{ authStrategy, ...otherOptions}=options;constauth=authStrategy(Object.assign({request: this.request,log: this.log,// we pass the current octokit instance as well as its constructor options// to allow for authentication strategies that return a new octokit instance// that shares the same internal state as the current one. The original// requirement for this was the "event-octokit" authentication strategy// of https://github.com/probot/octokit-auth-probot.octokit: this,octokitOptions: otherOptions},options.auth));hook.wrap("request",auth.hook);this.auth=auth;}constclassConstructor=this.constructor;for(leti=0;i<classConstructor.plugins.length;++i){Object.assign(this,classConstructor.plugins[i](this,options));}}};export{Octokit};
The build folder gets created, except for the index.html
What really is the issue and how can I resolve this?
The text was updated successfully, but these errors were encountered:
So I am using React for an application that makes calls to GitHub RESTapi using their octokit sdk.When I run the application using npm start, the application runs perfectly. Only when I use the command npm run build, I get an error related to octokit library.
This is my package.json file
and when i navigate to the directory path of the error and search for the 'body' variable, I do not find any...
The build folder gets created, except for the index.html
What really is the issue and how can I resolve this?
The text was updated successfully, but these errors were encountered: