frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

CORS issue when fetching() accuweatherAPI for <calendar> [5:58pm] #99

Closed frankcollins3 closed 11 months ago

frankcollins3 commented 11 months ago

attempting to do: titled.

error: dashboard:1 Access to fetch at 'http://dataservice.accuweather.com/locations/v1/cities/search?apikey=nokey&q=undefined&offset=25' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

proposed approach: more of a top level problem it seems. have to enable CORS which seemed to have been done with graphQL in pages/api

frankcollins3 commented 11 months ago

nvm was styling sass and mistyped the sass style at the end of the ENV import everything working. keeping as record of human mistake. [6:10pm]

frankcollins3 commented 11 months ago

interesting:

next-dev.js:20 Warning: A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components at input at div at RainyData (webpack-internal:///./components/elements/Rainydata/Rainydata.tsx:23:76) at div at eval (webpack-internal:///./node_modules/react-bootstrap/esm/Container.js:17:3) at div at eval (webpack-internal:///./node_modules/react-bootstrap/esm/Container.js:17:3) at commitMutationEffectsOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24288:9) at div at eval (webpack-internal:///./node_modules/react-bootstrap/esm/Container.js:17:3) at Dashboard at PromiseProvider (webpack-internal:///./Contexts/Promises.tsx:43:11) at ImgProvider (webpack-internal:///./Contexts/ImgContext.tsx:121:11) at Provider (webpack-internal:///./node_modules/react-redux/es/components/Provider.js:13:3) at div at App (webpack-internal:///./pages/_app.tsx:53:11) at PathnameContextProviderAdapter (webpack-internal:///./node_modules/next/dist/shared/lib/router/adapters.js:62:11) at commitMutationEffectsOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24571:9) at ReactDevOverlay (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:2:6707) at commitMutationEffectsOnFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:24571:9) at AppContainer (webpack-internal:///./node_modules/next/dist/client/index.js:173:11) at Root (webpack-internal:///./node_modules/next/dist/client/index.js:346:11) Rainydata.tsx:87 pre_location Response {type: 'cors', url: 'http://dataservice.accuweather.com/locations/v1/ci…nXhBUOi4R9JlJILWZGyBP6LkD&q=bergenfield&offset=25', redirected: false, status: 200, ok: true, …} Rainydata.tsx:89 pre_location [{…}] 0 : AdministrativeArea : {ID: 'NJ', LocalizedName: 'New Jersey', EnglishName: 'New Jersey', Level: 1, LocalizedType: 'State', …} Country : {ID: 'US', LocalizedName: 'United States', EnglishName: 'United States'} DataSets : (10) ['AirQualityCurrentConditions', 'AirQualityForecasts', 'Alerts', 'DailyAirQualityForecast', 'DailyPollenForecast', 'ForecastConfidence', 'FutureRadar', 'MinuteCast', 'Radar', 'TidalForecast'] EnglishName : "Bergenfield" GeoPosition : {Latitude: 40.928, Longitude: -73.997, Elevation: {…}} IsAlias : false Key : "334512" LocalizedName : "Bergenfield" PrimaryPostalCode : "07621" Rank : 55 Region : {ID: 'NAM', LocalizedName: 'North America', EnglishName: 'North America'} SupplementalAdminAreas : [{…}] TimeZone : {Code: 'EDT', Name: 'America/New_York', GmtOffset: -4, IsDaylightSaving: true, NextOffsetChange: '2023-11-05T06:00:00Z'} Type : "City" Version : 1 [[Prototype]] : Object length : 1 [[Prototype]] : Array(0)