ooade / nextsimplestarter Goto Github PK
View Code? Open in Web Editor NEW:whale: Simple and Accessible PWA boilerplate with Nextjs 12 and MUI
Home Page: https://nextss.vercel.app
License: MIT License
:whale: Simple and Accessible PWA boilerplate with Nextjs 12 and MUI
Home Page: https://nextss.vercel.app
License: MIT License
I've just been reading through the service worker specific code in your repo, and I'm assuming there's a good reason for sw.js being in the .next directory - I just wondered if you could enlighten me? I'm looking at how I get a service worker in my own code base, but am seeing if it's possible to be done entirely from a statically generated directory.
Thanks in advance.
Trying to do simple data fetching using next's getInitialProps
, but it's been hard to get it to work.
I believe this first error I get has to do with getting Babel configs right.
value: async function getInitialProps() {
^^^^^^^^
SyntaxError: Unexpected token function
at Object.exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at _callee$ (/user/NextSimpleStarter/node_modules/next/dist/server/require.js:33:46)
at tryCatch (/user/NextSimpleStarter/node_modules/regenerator-runtime/runtime.js:64:40)
After adding transform-runtime
the error seems to go away.
"plugins": [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}],
],
But still getInitialProps()
doesn't get called. You can check out my fork for code.
7.18.0
to 7.18.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 9 commits.
000d6b8
Update CHANGELOG and bump version
ffdf69a
[Fix] jsx-indent
: Does not check indents for JSXText
182b045
[Docs] use markdown-magic
to automatically sort all rules alphabetically
45b9d32
[Docs] jsx-props-no-spreading
: fix typo to use correct rule
f9aee94
[Fix] jsx-props-no-spreading
: add support for namespaced jsx components
e69b113
[Fix] jsx-no-target-blank
: allow rel to be an expression
fc6e406
[meta] fix changelog date
50df78f
[Fix] sort-comp
: |
isnβt a valid regex flag; u
and s
are
a7f6a8b
[Tests] on node
v13
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hi,
Today I tried your repo without touching anything
β Documents git clone https://github.com/ooade/NextSimpleStarter.git
Cloning into 'NextSimpleStarter'...
remote: Counting objects: 145, done.
remote: Total 145 (delta 0), reused 0 (delta 0), pack-reused 145
Receiving objects: 100% (145/145), 127.71 KiB | 0 bytes/s, done.
Resolving deltas: 100% (64/64), done.
β Documents cd NextSimpleStarter
β NextSimpleStarter git:(master) yarn install
yarn install v0.21.3
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "[email protected]" has unmet peer dependency "webpack@^1 || ^2.1.0-beta || ^2.2.0-beta".
warning "[email protected]" has unmet peer dependency "glob@*".
[4/4] π Building fresh packages...
β¨ Done in 9.28s.
β NextSimpleStarter git:(master) yarn run build
yarn run v0.21.3
$ next build
> Using "webpack" config function defined in next.config.js.
Total precache size is about 29.63 kB for 6 resources.
β¨ Done in 9.32s.
β NextSimpleStarter git:(master) ls build
ls: build: No such file or directory
The build folder is not created. Do you know what's happening?
Thanks!
We started this project not quite long after Next.js became public and we haven't really touched the README π
We've just been improving the code section and making it a lot better. I guess it's time to give the README a new structure, basically to pass the right message to new users.
Let's do this! π
Hi! Thanks for this starter project, it's really helpful π
Do you have any plans to add redux-offline to your example?
In order to check PWA on dev machine, I built the app and yarn run start. But the project showed an error in console:
Failed to load resource: net::ERR_INVALID_RESPONSE :3000/sw.js
text word
Currently, it has an aria-hidden
attribute π
An aria-label
of "Delete Todo" should do.
To turn on Screen Reader on Mac: Cmd + F5
Branch | Build failing π¨ |
---|---|
Dependency | next |
Current Version | 2.3.1 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
next is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
Improve error handling, HMR, Windows support (+CI tests)
Huge thanks to @Reggino, @arunoda, @silvenon, @aranajhonny, @paulxuca, @Grokling, @Rowno, @Ehesp, @brikou, @raygesualdo and @timneutkens for their help!
The new version differs by 34 commits.
b005258
Release 2.4.0
0926129
Release 2.3.2
bcb979f
Add some Appveyor customizations (#1985)
17cc77f
Add appveyor.yml file (#1984)
650bb7c
Fix hmr failing issue. (#1968)
b8f336c
Add custom webpack dev middleware config (#1931)
3306262
chore(package): update jest-cli to version 20.0.1 (#1941)
85af828
chore(package): update babel-jest to version 20.0.1 (#1940)
bc71b89
Remove stage-0 from example (#1959)
2ea6196
Fix react-md example
9754395
chore(package): update cross-env to version 5.0.0 (#1944)
e53bcdb
fix(package): update prop-types to version 15.5.10 (#1954)
f4d6cbf
Many improvements to the Apollo examples (#1905)
3b91355
Improve styled-jsx section of readme (#1932)
2f4a662
Fix windows sub-path dev rebuild failed issue. (#1930)
There are 34 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
[ ready ] compiled successfully - ready on http://localhost:3000
Warning: the Container
in _app
has been deprecated and should be removed. https://err.sh/zeit/next.js/app-container-deprecated
Getting such error on start, how can I handle it?
I got this error right away after downloading the starter and running npm run build
and npm run start
.
{ Error: Cannot find module '/Users/Dan/work/b/original/.next/server/static/yOGv7a1uTpivdY1RQ64A1/pages/_document'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.loadComponents (/Users/Dan/work/b/original/node_modules/next-server/dist/server/load-components.js:16:24)
at Server.renderToHTMLWithComponents (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:198:48)
at Server.renderErrorToHTML (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:228:21)
at Server.renderError (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:221:33)
at Server.render404 (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:237:21)
at Object.fn (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:120:32)
at /Users/Dan/work/b/original/node_modules/next-server/dist/server/router.js:23:36
at Server.run (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:157:23)
at Server.handleRequest (/Users/Dan/work/b/original/node_modules/next-server/dist/server/next-server.js:80:21)
at Server.emit (events.js:189:13)
at parserOnIncoming (_http_server.js:676:12)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17) code: 'MODULE_NOT_FOUND' }
π¨ Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! π ππ¨ π
Find out how to migrate to Snyk at greenkeeper.io
9.3.6
to 9.4.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
next is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
role=link
should open on [Enter]: #12460@babel/preset-typescript
to be configured: #11840source-map
package: #12355lerna.json
: 93a94b8.amp
to pathname: #12528moduleId
not resolving correctly on Windows: #12584react-refresh
for SC: #12627Huge thanks to @jamespohalloran, @lfades, @aemiro-allison, @ijjk, @taylorbryant, @Timer, @ykzts, @plug-n-play, @fabianishere, @vvo, @matamatanot, @chibicode, @karlhorky, @christianalfoni, @sangotaro, @liulanz, @dalibor-123, @stefanjudis, @Kiarash-Z, @hossam-magdy, @mit123suki, @robinweser, @lncls, @kohchihao, @connormcwood, @davidcsally, @roniemeque, @piyu-sh, @jonespen, @joemccann, @makezi, @TxHawks, @devknoll, @jokester, @piglovesyou, @austinhumes-valtech, @rafaelalmeidatk, @arcanis, @timneutkens, @mlorthiois, @huozhi, @lachlanjc, @sebastianbenz, @AlexanderVishnevsky, @mxschmitt, @janicklas-ralph, @NavizDev, @PabloSzx, @tywmick, @lwz7512, @justincy, @Skn0tt, @eps1lon, @maxigimenez, @sarupbanskota, @belgattitude, and @dpyzo0o for helping!
The new version differs by 155 commits.
6d1167e
v9.4.0
f9e24ab
v9.3.7-canary.21
7cca2b0
Add test for API route with fetch polyfill (#12680)
29b1100
fix logout in with-iron-session example (#12704)
653098d
Use @/ to show module alias instead of @ prefixed (#12600)
0b36211
[Docs] Environment Variables (#12696)
4acad75
Link Made by Vercel to vercel.com (#12702)
0900d57
v9.3.7-canary.20
467b2c7
Enable sassOptions support in next.config.js (#12685)
e3aeb2f
Update code sample in performance measurement docs (#12690)
f0220e6
[Examples] Update firebase authentication (#12687)
565e111
v9.3.7-canary.19
8b51e00
Upgrade deps (#12700)
ae1daea
Enable Fast Refresh by Default (#12640)
0bc0760
chore(next): link/router/document missing types (#12692)
There are 155 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
The static
folder was deprecated in Next 9.1.
This repository should be restructured to use the public
folder. We should be able to just get away with public/static/
by copying the static
folder to public
.
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If youβre interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didnβt already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didnβt touch job or matrix configurations because these tend to be quite specific and complex, and itβs difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what youβre doing it may require additional work or may not be applicable at all. Weβre also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, Iβm a humble robot and wonβt feel rejected π€
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Running the demo app (https://next-preact.now.sh/), I have noticed the following error in the console log:
Uncaught (in promise) TypeError: Cannot read property 'join' of undefined
On Firefox only, when trying to add a todo I receive a "Secure Connection Failed" error. Works on chrome though. π
I'm accessing TvMaze API which is https and Zeit is using https. But after deployment none of my images are being loaded here:
https://next-simple-starter-uhnprynavy.now.sh/articles
Code: https://github.com/ahmedmusawir/moose-next-pwa-rdx-bp
with this error:
workbox-core.prod.js:1 Mixed Content: The page at 'https://next-simple-starter-uhnprynavy.now.sh/sw.js' was loaded over HTTPS, but requested an insecure resource 'http://static.tvmaze.com/uploads/images/medium_portrait/136/342479.jpg'. This request has been blocked; the content must be served over HTTPS.
The same app is working fine here using other boilerplate. Here:
https://next-boilerplate-stsxcshqwn.now.sh/articles
Code: https://github.com/ahmedmusawir/next-boilerplate-1
I'm pretty new at this. Just looking for some help. Thanx.
I tried exactly same installation that you provide in documentation, In my case the manifest file identity doesn't matches where your https://nextss.now.sh/ this one matches,can you little help what went wrong to solve this issue. I am using to host this on AWS to check, not on Now(Zeit). The install button on the address bar is not also showing in my case.
6.0.0
to 6.0.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
react-redux is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
This is a minor release with support for react-hot-loader and a few small bug fixes for edge cases.
While you're here, please stop by #1177 to see our roadmap for the next versions of React Redux. We are aware that performance is not so hot in 6.0. Short version: We put too much traffic on React's context API, which isn't really designed for high levels of reads and writes. We're looking to reduce that load and get performance back on track in a minor release, so there won't be backwards compatibility concerns. We have a new extensive benchmark suite to keep us on track and ensure we're not regressing on speed in the future.
And yes, we know about Hooks. Check out #1179.
context
prop really contains a React context (#1134 by @casdevs)The new version differs by 35 commits.
162b81a
6.0.1
d8a7ab5
Update build deps. Add React 16.8 tests.
6ad2b55
Remove --save option as it isn't required anymore (#1193)
fac9ad1
Update Provider.md and quick-start.md (#1182)
9bf2375
Update Provider.md
fcd5ed8
Update Provider.md
c198249
Update react-router usage example (#1180)
ab77450
Upgrade to react-is v16.7.0 (#1174)
0bf4e1f
Remove duplicate line in connect api documents (#1173)
6e0a106
Updated: Support React-Hot-Loader compatibility (#1168)
63af52f
Update accessing-store.md (#1163)
5199d9d
Ensure that component prop 'context' really contains a React context β¦ (#1134)
e7661b3
Fix spacing issues (#1153)
75b90f9
Add / change docs about v6 (#1148)
5088345
Add connect()
API doc (#1140)
There are 35 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
2.20.0
to 2.20.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 23 commits.
45f0860
Bump to v2.20.1
5d00854
[Fix] order
: Fix alphabetize for mixed requires and imports
bbd166b
[Fix] export
: Handle function overloading in *.d.ts
4665ec5
[Fix] no-absolute-path
: fix a crash with invalid import syntax
392c6b9
[Fix] named
: for importing from a module which re-exports named exports from a node_modules
module
cc5bde5
[Tests] named
: add failing test for #1446
aff3a46
[meta] fix "files" field to include/exclude the proper files
986ba74
docs: fix a few spelling mistakes
6274d96
[Tests] set eslint-plugin/consistent-output
lint rule to always require test case output assertions
a4d301b
[meta] add missing changelog links
2d42464
[Tests] only run the linter once, not on every build
26f232b
[Tests] add eslint-plugin-eslint-plugin internally and fix violations
99647f1
[Docs]: Update Tidelift language to enterprise
f84d457
no-duplicates
: allow duplicate if one is namespace and other not
7e71b50
[Fix] extensions
: Fix scope regex
There are 23 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Monorepo release group | react |
Current Version | 16.4.2 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the react group definition.
react is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
3.3.0
to 3.4.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
react-axe is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 9 commits.
75a3ead
Merge pull request #131 from dequelabs/release-3.4.0
738af2a
chore(release): 3.4.0
427ffc4
Merge pull request #129 from dequelabs/deps
4ddbcc2
chore: update dependencies
c37fc18
feat: Support Axe-core context param (#127)
04f9b1f
ci: bust cache and add missing dependency styled-components
(#128)
2d79880
chore(deps): [security] bump handlebars from 4.1.2 to 4.5.3 (#126)
31d182b
chore: Simplify PR template (#110)
79ef439
chore: Merge pull request #109 from dequelabs/master
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hi!
I tried to run the example mentioned in the readme but its throwing this error:
{ SyntaxError: /.babelrc: Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""
at error (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/json5/lib/json5.js:56:25)
at word (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/json5/lib/json5.js:393:13)
at value (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/json5/lib/json5.js:493:56)
at Object.parse (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/json5/lib/json5.js:508:18)
at ConfigChainBuilder.addConfig (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:150:65)
at ConfigChainBuilder.findConfigs (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:96:16)
at buildConfigChain (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-core/lib/transformation/file/options/build-config-chain.js:61:13)
at findBabelConfig (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/build/babel/find-config.js:25:53)
at _callee2$ (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/build/webpack.js:369:60)
at tryCatch (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at Promise.F (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js:35:28)
at /Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
at createCompiler (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/build/webpack.js:546:17)
at HotReloader._callee2$ (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/hot-reloader.js:224:69)
at tryCatch (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at Promise.F (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/node_modules/core-js/library/modules/_export.js:35:28)
at HotReloader.<anonymous> (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
at HotReloader.start (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/hot-reloader.js:253:22)
at Server._callee$ (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/next/dist/server/index.js:157:41)
at tryCatch (/Users/mehulahuja/Desktop/freeways-web-2/node_modules/regenerator-runtime/runtime.js:65:40)
message: '/.babelrc: Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. Still to read: ""',
at: 1,
lineNumber: 1,
columnNumber: 2 }
I'm running OSX (Sierra)
Node version 6.10.3
Are there any support for Background Sync https://developers.google.com/web/tools/workbox/modules/workbox-background-sync and or a way to handle API calls in offline?
I am using simple http server instead of express, but when i write this
createServer.get('/sw.js', (req, res) => res.sendFile(path.resolve('./.next/sw.js')));
it through error that server.get is not a function
`const next = require('next')
const routes = require('./routes')
const app = next()
const handler = routes.getRequestHandler(app)
// Without express.js
const {createServer} = require('http')
createServer.get('/sw.js', (req, res) => res.sendFile(path.resolve('./.next/sw.js')));
createServer.get('*', (req, res) => handle(req, res));
app.prepare().then(() => {
createServer(handler).listen(4000, err => {
if (err) throw err
console.log('> Ready on http://192.168.84.7:4000')
})
})`
please help me out how to get sw.js file using simple http server
Error message in the console shows....
SW registration failed: TypeError: Failed to register a ServiceWorker for scope ('https://stupefied-franklin-ead670.netlify.com/') with script ('https://stupefied-franklin-ead670.netlify.com/service-worker.js'): A bad HTTP response code (404) was received when fetching the script.
The build files generate and SW.js, rather than a service-worker.js.
Could there be some additional configuration I am missing?
7.18.2
to 7.18.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 2 commits.
0a717a5
Update CHANGELOG and bump version
8b576be
[Fix] jsx-indent
: don't check literals not within JSX
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Using now 2 will make us remove the server.js file since you can match paths to file with the config file.
Hello,
I used this boilerplate to migrate a project made with Create-React-App using Redux, and I have to say that it's been a complete headache understanding the SSR with React, but I'm almost done with it. I'm new using NextJS and I want to know how can I get the state from the Store, for example I want to use the URL prop on my ComponentWillMount of Blog.
Here is my store:
import { createStore, compose, applyMiddleware } from 'redux'
import rootReducer from '../reducers'
import { MenuActiveLink } from '../reducers/menuReducer';
import {
CurrentAgent,
CurrentProperty,
CurrentBlogPost
} from '../reducers/CurrentReducer';
import {
loadPropertiesFilters,
ChangeListingTypeSearch,
clearSegmetation,
chargeSegmentationValues
} from '../reducers/PropertiesReducer';
const state = {
url:'http://localhost:8000/api/v1',
staticUrl: 'http://localhost:8000',
mediaUrl: 'http://localhost:8000/media/',
ListProperties: [],
currentPage:'inicio',
PropertiesList:[],
ListingTypeSearch:'',
currentProperty: '',
currentBlogPost: '',
currentAgent: '',
segmentation:'',
segmentationData:'',
}
const enhancers = compose(
typeof window !== 'undefined' && process.env.NODE_ENV !== 'production'
? window.devToolsExtension && window.devToolsExtension()
: f => f
)
const reducer = (state, action) => {
switch (action.type) {
case 'MenuActiveLink':
return MenuActiveLink(state,action);
case 'loadPropertiesFilters':
return loadPropertiesFilters(state,action);
case 'ChangeListingTypeSearch':
return ChangeListingTypeSearch(state,action);
case 'CurrentProperty':
return CurrentProperty(state,action);
case 'CurrentBlogPost':
return CurrentBlogPost(state,action);
case 'CurrentAgent':
return CurrentAgent(state,action);
case 'clearSegmetation':
return clearSegmetation(state,action);
case 'chargeSegmentationValues':
return chargeSegmentationValues(state,action);
case 'URL':
return {...state, url: action.payload};
default:
break;
}
return state;
}
const createStoreWithMiddleware = applyMiddleware()(createStore)
export default initialState =>
createStoreWithMiddleware(rootReducer, initialState, enhancers, reducer, state)
and here is the component where I want to get the state for the URL for example:
import React, {Component} from 'react';
import HeaderBlue from '../components/Layouts/Header/HeaderBlue'
import Slider from "react-slick";
import {Tabs, Tab} from 'tabler-react';
import {Container, Row, Col} from 'reactstrap';
import {connect} from 'react-redux';
import axios from 'axios';
import withRedux from "next-redux-wrapper";
// Demo Imports
import BlogCard from '../components/Blog/BlogCard';
import BlogSlider from '../components/Blog/BlogSlider'
const getState = (state) => {
return {
url: state.url,
}
}
const Dispatch = (dispatch) =>{
return{
loadBlogPost: (id) =>{
const action ={
type: "CurrentBlogPost",
id:id,
}
dispatch(action)
},
}
}
class Blog extends Component {
constructor(props) {
super(props);
this.state = {
blogposts: [],
}
}
static async getInitialProps({ store }) {
// Adding a default/initialState can be done as follows:
// store.dispatch({ type: 'ADD_TODO', text: 'It works!' });
console.log(store.state)
const res = await fetch(
'https://api.github.com/repos/ooade/NextSimpleStarter'
)
const json = await res.json()
return { stars: json.stargazers_count }
}
componentWillMount = () => {
let url = this.props.url
axios.get(url + '/blog/')
.then(response => {
this.setState({ blogposts: response.data.results })
})
}
getBlogPost = (e) =>{
let id = e.target.getAttribute('data-id')
this.props.loadBlogPost(id)
this.setState({redirect:true})
}
render() {
const settingsMainSlider = {
dots: false,
infinite: true,
speed: 1000,
slidesToShow: 3,
slidesToScroll: 3,
autoplay: true,
arrows: false,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
initialSlide: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
};
return (
<div>
<HeaderBlue blog="active"/>
<section id="slider">
<Slider {...settingsMainSlider}>
{this.state.blogposts.map(e => {
return (
<BlogSlider
title={e.title}
blogId={e.id}
imgSrc={e.image}
onClick={this.getBlogPost}
getBlogPost={this.getBlogPost}
/>
)
})}
</Slider>
</section>
<section id="categoryFilter" style={{paddingBottom: '100px'}}>
<Tabs initialTab="Portada">
<Tab title="Portada">
<Container className="pt-4">
<div className="blogCategories-container">
<div>Prop from Redux [{this.props.foo}]</div>
<div>Prop from getInitialProps [{this.props.custom}]</div>
<h5 style={{ marginBottom: '0', fontSize: '1.5rem' }}>Tips & Recomendaciones</h5>
<span className="opacity5 text-muted">Ver todas las entradas »</span>
</div>
<Row>
{this.state.blogposts.map(e => {
return (
<Col sm={4}>
<BlogCard
key={e.id}
title={e.title}
imgSrc={e.image}
category={e.category}
// Prop related
blogId={e.id}
onClick={this.getBlogPost}
getBlogPost={this.getBlogPost}
/>
</Col>
)
})}
</Row>
</Container>
</Tab>
</Tabs>
</section>
</div>
)
}
}
export default connect()(Blog);
Any ideas of how to get this done would help me a lot.
Two errors relating to service worker. Can you also explain the service worker in more detail?
Error: ENOENT: no such file or directory, stat '/Users/paulwilson/vermonster/opensource/resistance-calendar/.next/sw.js'
Uncaught (in promise) TypeError: Request scheme 'chrome-extension' is unsupported
at sw.js:formatted:279
I followed all the steps to make the app work, but the live-reload doesn't work, in order for the project to work I have to build then run yarn dev, am I mmissing something, thanks in advance.
Hooks can only be called inside of the body of a function component.
dependency
react was updated from 16.6.1
to 16.6.2
.dependency
react-dom was updated from 16.6.1
to 16.6.2
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
This monorepo update includes releases of one or more dependencies which all belong to the react group definition.
react is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hey, thanks or this boilerplate, i think it'w awesome. but apparently redux devtools doesn't work.
any hint on that?
I would love to know how you would approach this problem.
for example when you have 3 pages:
page1
page2
page3
and you only want service worker to include page1.
We'll be changing the entire project to using Material Components Web. It's currently using Material Design Lite.
Reason for change:
They don't update mdl again, since they now have mcw.
Clone the repo, and use lighthouse(Audits) as a guide.
Cheers π
I need add code to create push notificacion add background sync, any ideas?
5.1.0
to 5.2.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-config-react-app is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 41 commits.
d7c6842
Publish
a7b8732
Prepare 3.3.1 release
4da41b4
docs: Add troubleshooting documentation on ENOSPC (#8380)
03018d7
Update docs according to lint-staged v10 (#8394)
6ee4e91
Add helpful message to the footer (#6548)
ed162a3
Add "Disallow:" to robots.txt (#8255)
e530598
Fix sass importLoaders (#8281)
dd0df73
Remove outdated docs regarding vscode eslint extension and type⦠(#8307)
ca9c61e
Update setting-up-your-editor.md (#8247)
cafd602
Update custom template docs with instructions for testing custom template locally (#8092)
720d90b
Sync dependencies babel config (#8120)
ddcb7d5
Add titleProp to SVGR ReactComponent type definition (#8099)
b855da5
Remove outdated babel plugins (#8353)
4bf14fa
Downgrade open from 7.0.0 to 6.4.0 (#8364)
dada035
Remove React.FC from Typescript template (#8177)
There are 41 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
So I've been trying to port an existing app to use this Boilerplate. When I finally finish everything and try to deploy, I'm getting this error when running the build:
Error: Cannot find module 'react'
And removing the preact
alias doesn't help...
lighthouse can't perform a test on https://next-preact.now.sh.
Branch | Build failing π¨ |
---|---|
Dependency | next |
Current Version | 6.0.3 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
next is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
dist
to server
to be more consistent: #4506Recipes
section: #4661with-material-ui
per #4439: #4444Huge thanks to @ex3ndr @teleginzhenya, @Zn4rK, @bennygenel, @brikou, @scaasic, @oliviertassinari, @fatfisz, @andrewmclagan, @koss-lebedev, @davscro, @tobitos, @ngauthier, @skv-headless, @rovansteen, @giautm, @swissspidy, @teleginzhenya, @jthegedus, @lon-io, @mmiszy, @vasco3, @dlcoffee, @quietshu, @klyburke, @toolmantim @gHashTag, @TheRobBrennan, @lukebarton, @tvthatsme, @joaogranado, @rwieruch, @andy-viv, @AriLFrankel, @vladnicula, @JeromeFitz, @elrumordelaluz, @Yuripetusko, @yhirano55, @nwalters512, @lucleray, @lfades, @jonespen, @sampsonjoliver, @DevSpeak, and @loganfsmyth for helping!
The new version differs by 103 commits.
512f16e
6.1.0
7fcfb8b
Make production compilation faster (patch) (#4677)
1ebd996
6.0.4-canary.9
85769c3
Pass through buildId to webpack config in development (#4665)
e70c595
Add example to Recipes
section (#4661)
36c82fd
Fix incorrect wording (#4658)
6ed2da4
with-socket.io Example updated with _app.js (#4644)
f4af03b
Remove unneeded async (#4635)
91900d1
Update "url deprecated" error docs with note re: React Dev Tools (#4652)
0989ecc
[with-jest]Β Move jest deps to devDeps (#4650)
3ae9f87
Rephrase url deprecation text and add link to next-codemod (#4649)
6cba9fa
Remove the React 15 support comment (#4648)
67cb87a
Added with-unstated example (#4628)
fc2d59d
Add class properties configuration (#4619)
bf882eb
Failing test for #4620 (#4625)
There are 103 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Getting this error (Uncaught ReferenceError: webpackHotUpdate is not defined
) while runnign npm run dev
I guess we didn't notice that because we only have one page here.
offline
because it does not only install the service worker but also update it.A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.