Giter VIP home page Giter VIP logo

pankod / next-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
1.6K 37.0 279.0 7.45 MB

A well-structured production ready Next.js boilerplate with Typescript, Redux, Jest, Enzyme, Express.js, Sass, Css, EnvConfig, Fetch, Reverse Proxy, Bundle Analyzer and Built-in Project CLI. https://pankod.github.io/next-boilerplate/

License: MIT License

JavaScript 9.39% TypeScript 88.06% Dockerfile 0.46% Shell 0.37% SCSS 1.71%
boilerplate typescript redux react sass babel nextjs nextjs-template starter storybook

next-boilerplate's People

Contributors

abdelazizmalfy avatar aliemir avatar batuhanw avatar biskuvit avatar dependabot[bot] avatar drcivan avatar gokaygurcan avatar mandymoorefan avatar mehmetsefabalik avatar mhrrmk avatar omeraplak avatar theykk avatar tmrdurgun avatar yildirayunlu 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

next-boilerplate's Issues

Contributing

Hi!

I really find your boilerplate useful and I added to => https://github.com/dzharii/awesome-typescript .

Now I think If you added contributing guide it will be useful for you and who want to improve your boilerplate.

If you want I can help for creating an issue template and creating contributing file.

Have a nice day!

CSS Modules?

NextJs comes with css module support but it doesn't seem to work in this boilerplate. Has it been overridden by the Styled components? How would I go about enabling css module support.

Storybook

Add storybook with;

  • Styled ThemeProvider
  • Redux Provider
  • Addon knobs
  • Addon Responsive
  • Static path set to public path

Unnecessary options in jest configuration file

moduleFileExtensions: ["js", "jsx", "ts", "tsx"],

testMatch: ["**/*.(test|spec).(ts|tsx)"],

these rules are set by default by jest configuration, and are more inclusive in some cases if you use the __test__ pattern folder or if you reference the json file in any of your tests.

moduleFileExtensions [array]

Default: ["js", "json", "jsx", "ts", "tsx", "node"]

testMatch [array]

(default: [ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ])

Remove Redux devtool in production mode

Hi there,
for better performance in production mode (e.g. lighthouse) is better remove Redux devtool because load a js bundle of 400k size.

In Redux/store.ts

const bindMiddleware = (...middleware: Middleware[]) => {
  if (process.env.NODE_ENV !== "production") {
    // eslint-disable-next-line global-require
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const { composeWithDevTools } = require("redux-devtools-extension");

    return composeWithDevTools(applyMiddleware(...middleware));
  }
  return applyMiddleware(...middleware);
};

export const makeStore = (initialState: {}) => {
    return createStore(
        Reducers,
        initialState,
        bindMiddleware(thunkMiddleware)
    );
};

Scaffolding tool missing templates

I got an error while using the CLI command to scaffold a new page alongside a new reducer and style file.
The script failed to resolve some required mustache templates,

  • templates/reducers/action-index.mustache
  • templates/interfaces/redux-import.d.mustache
npm run cli

> [email protected] cli [..omitted]/next-boilerplate
> node ./project-cli/dist/index.js a
  ____             _             _
 |  _ \ __ _ _ __ | | _____   __| |
 | |_) / _` | '_ \| |/ / _ \ / _` |
 |  __/ (_| | | | |   < (_) | (_| |
 |_|   \__,_|_| |_|_|\_\___/ \__,_|

? What do you want to add? page
? Enter page name about
? Do you want to add custom route or use default route name? No, use default.
? Do you want to have a connection to store? Yes
? Do you want to create a new reducer or use your own? Yes, I want to have new reducer.
? Do you want to add a style file? Yes
✔ Added new class component
✔ Added new interface file
✔ Interface file added to Interfaces/index.ts
✔ Interface file added to Interfaces/Redux/Store.d.ts
✔ Added new reducer file
✔ Reducer added to Redux/Reducers/index.ts
✔ Reducer file added combineReducers in Redux/Reducers/index.ts
✔ Action constants added to Definations/ActionConsts.ts
(node:6134) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '[..omitted]/next-boilerplate/project-cli/helper_scripts/templates/reducers/action-index.mustache'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:348:35)
    at Object.getTemplate ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:41:71)
    at Object.getFileContent ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:160:50)
    at Object.addIndex ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:55:67)
    at Object.addAction ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:163:24)
    at Object.createClassComponent ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:218:28)
    at Object.<anonymous> ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/page-component.js:86:25)
    at Generator.next (<anonymous>)
    at fulfilled ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/page-component.js:4:58)
(node:6134) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6134) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
fs.js:119
    throw err;
    ^

Error: ENOENT: no such file or directory, open '[..omitted]/next-boilerplate/project-cli/helper_scripts/templates/interfaces/redux-import.d.mustache'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:348:35)
    at Object.getTemplate ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:41:71)
    at Object.getFileContent ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:98:58)
    at Object.replaceContent ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:119:81)
    at Timeout.setTimeout [as _onTimeout] ([..omitted]/next-boilerplate/project-cli/dist/helper_scripts/definations/helper.js:102:32)
    at listOnTimeout (internal/timers.js:535:17)
    at processTimers (internal/timers.js:479:7)

next-i18next

I like so much this boilerplate, but i need next-i18next, you can help me config it, thanks you :D

Module resolution in tsconfig alias is not working

Error

I just add Utils/logger folders in src. but when i want to use a file inside that foler in server/index with alias throws the following error:

Error: Cannot find module '@Utils/logger'

can't solve the imports either, if I use absolute routes and no aliases it works. the problem is only with this folder.

Changes made

ts.config

{ "compilerOptions": { "baseUrl": ".", "paths": { "@Utils/*": ["src/Utils/*"], "@Utils": ["src/Utils"] } } }

.babelrc

{ "presets": ["next/babel"], "plugins": [ [ "module-resolver", { "root": ["./"], "alias": { "@Utils": "./src/Utils" } } ] ] }

Creating a page using the CLI breaks the app

Using the CLI to generate a page throws the following error:

[nodemon] starting `node app/server.js`
/home/david/Dev/site/app/routes.js:4
    .add('/a-propos', '/a-propos/index')
    ^

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:743:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/david/Dev/site/app/server.js:13:16)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
    at internal/main/run_main_module.js:21:11
[nodemon] app crashed - waiting for file changes before starting...

The lines in routes.js looked like this:

routes.add('/', '/home/index');
.add('/a-propos', '/a-propos/index')

Removing the semicolon solved the issue.

Edit: I guess that's an expected behavior but pages with a name that includes a dash throw errors too. That should be added to the doc since the only specified requirement is not to use "spaces".

ERROR  Failed to compile with 1 errors                                                             02:29:24

error  in ./pages/a-propos/index.tsx

Syntax Error: SyntaxError: /home/david/Dev/site/pages/a-propos/index.tsx: Unexpected token, expected ",
" (10:11)

  8 | 
  9 | //#region Interface Imports
> 10 | import { IA-Propos } from '@Interfaces';
    |            ^
 11 | //#endregion Interface Imports
 12 | 
 13 | class A-Propos extends React.Component<IA-Propos.IProps, IA-Propos.IState> {

NPM audit

I just runned
npm install
and audit gave me this:
found 4083 vulnerabilities (4070 low, 1 moderate, 12 high) runnpm audit fixto fix them, ornpm auditfor details
I think this is a little bit too many

Problem w Installation

Ekran Resmi 2019-05-09 17 49 31

node version => 12.1.0

When I cloned repository and run npm install I had a problem:

> [email protected] build /Users/tamay/next-boilerplate/project-cli
> tsc

node_modules/@types/node/globals.d.ts:597:17 - error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'.

597         [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
                    ~~~~~~~~~~~~~

node_modules/@types/node/globals.d.ts:597:35 - error TS2304: Cannot find name 'AsyncIterableIterator'.

597         [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
                                      ~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/node/readline.d.ts:107:17 - error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'.

107         [Symbol.asyncIterator](): AsyncIterableIterator<string>;
                    ~~~~~~~~~~~~~

node_modules/@types/node/readline.d.ts:107:35 - error TS2304: Cannot find name 'AsyncIterableIterator'.

107         [Symbol.asyncIterator](): AsyncIterableIterator<string>;
                                      ~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/node/stream.d.ts:95:21 - error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'.

95             [Symbol.asyncIterator](): AsyncIterableIterator<any>;
                       ~~~~~~~~~~~~~

node_modules/@types/node/stream.d.ts:95:39 - error TS2304: Cannot find name 'AsyncIterableIterator'.

95             [Symbol.asyncIterator](): AsyncIterableIterator<any>;
                                         ~~~~~~~~~~~~~~~~~~~~~

node_modules/@types/node/ts3.1/index.d.ts:10:21 - error TS2727: Cannot find lib definition for 'esnext.asyncıterable'. Did you mean 'esnext.asynciterable'?

10 /// <reference lib="esnext.asyncIterable" />
                       ~~~~~~~~~~~~~~~~~~~~


Found 7 errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tamay/.npm/_logs/2019-05-09T12_30_45_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] postinstall: `cd project-cli && npm i && npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I fixed with changing to in node_modules/@types/node/ts3.1/index.d.ts

This problem probably not from you but who facing with this problem can solve like this.

GraphQL support

Your boilerplate is really nice, i love it.
It is possible to add option to replace redux with GraphQL?

Typescript Linting Errors on VS Code

Has this repo been tested on VS Code? I see lots of TypeScript errors via VS Code Problems tab which kinda irks me.

Like _app.tsx results in:

(JSX attribute) store: Store<any, AnyAction>
The single Redux store in your application.

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ProviderProps<AnyAction>>): Provider<AnyAction>', gave the following error.
    Type 'IStore' is missing the following properties from type 'Store<any, AnyAction>': dispatch, getState, subscribe, replaceReducer, [Symbol.observable]
  Overload 2 of 2, '(props: ProviderProps<AnyAction>, context?: any): Provider<AnyAction>', gave the following error.
    Type 'IStore' is not assignable to type 'Store<any, AnyAction>'.ts(2769)
index.d.ts(397, 5): The expected type comes from property 'store' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Provider<AnyAction>> & Readonly<ProviderProps<AnyAction>> & Readonly<{ children?: ReactNode; }>'
index.d.ts(397, 5): The expected type comes from property 'store' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Provider<AnyAction>> & Readonly<ProviderProps<AnyAction>> & Readonly<{ children?: ReactNode; }>'

and index.tsx results in

class HomePage
Argument of type 'typeof HomePage' is not assignable to parameter of type 'NextComponentType<{}, {}, NextContext<Record<string, string | string[] | undefined>>>'.
  Type 'typeof HomePage' is not assignable to type 'NextComponentClass<{}, {}, NextContext<Record<string, string | string[] | undefined>>>'.
    Type 'typeof HomePage' is not assignable to type 'ComponentClass<{}, any>'.
      Types of parameters 'props' and 'props' are incompatible.
        Type '{}' is not assignable to type 'IProps'.
          Type '{}' is missing the following properties from type 'IOwnProps': t, i18nts(2345)

The yarn build itself doesn't throw any errors to be clear.

Next Right Now boilerplate

Hello there! Great job at creating Next Boilerplate, it really looks interesting. I'll take a peek to see what I can re-use for https://github.com/UnlyEd/next-right-now, which is an alternative boilerplate (same purpose, different implementation)

Since we're all about sharing and spreading knowledge, I wanted to let you know that I'm heavily working on the SSG support (working already) through PR UnlyEd/next-right-now#42

I believe Next Boilerplate still uses the "old" SSR approach (I quickly had a look around), but if you'd like to see how SSG can be implemented then don't hesitate to see at how I did it in the above PR.

I hope we can share good tips and spread good practices better together! My latest discovery (yesterday) was https://github.com/welldone-software/why-did-you-render which is very useful for helping devs to detect useless re-renders. Very simple to implement as well: https://github.com/UnlyEd/next-right-now/pull/52/files#diff-76ad791c100f00f39c533e71f055643cR29-R47

May be a great addition for Next Boilerplate?

I mean to finish the 2 big PRs I'm working on and then I hope I'll have time to take a deeper look to Next Boilerplate and see what else would benefit NRN. Meanwhile, if you have any suggestion, they're welcome!

Keep up the great work! 👍

[Question]: How to handle private routes in your template?

Hi Guys,

Great work, this template is really a great boilerplate. I have one question only for now.

How can we achieve the private routes in this template?

I tried the HOC component but it's not working due to getInitialProps in pages. There is no store in ctx object. The same thing tried with Component also. but got the same error.

So any idea for this in your mind?

Thank you.

Regards,
M. Adil

throw err

npm install
internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module '../lib/utils/unsupported.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:153:3)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

Next Right Now boilerplate <> next-boilerplate

Hello dear maintainers!

Great job building this awesome boilerplate, I don't think I was aware of it until today.

I might take a few things from what you've done, so I felt obligated to share about things you might be interested in adding to the next-boilerplate! 😉

Check out Next Right Now scripts and utilities and API endpoints, which are probably the easier for you to benefits from. 😄

If you're interested in other features, have a look at our different presets and demo, maybe there are other things you'd like to add.

Don't hesitate to ask me regarding implementation detail, if needed. 😃

Also, I took the liberty to reply in some open issues to provide guidance whenever the Next Right Now boilerplate can help. I hope it's alright!

Missing 404 page

with a fresh install we get he below warning.

Warning: You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized. see here for info: https://err.sh/next.js/custom-error-no-custom-404

I'm using VSCode Jest extension

And Jest extension show me this error. Whats wrong it?. How to fix this error?
Environment:
Windows10 64bit
Node :12.16.1
Vscode :1.44.2
Jest extension: 3.1.1

image

Can I import this boilerplate directly to CodeSandBox.io?

When I tried this, it got the below error through
https://codesandbox.io/s/pensive-river-id3ch

$ cross-env NODE_ENV=production node dist/index.js
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '/sandbox/dist/index.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.21.1

Typescript & Babel

For me it sounds confusing using Babel on a typescript codebase (i.e both add js shims into the generated code).

Could you please tell why you made this choice? What benefits does Babel add for typescript development?

Please don't see it as a criticism, I'm genuinely curious about this.

app directory .js files converted to .ts files eslint errors

Why app directory files routes.js and server.js are not converted into .ts files? Is this a typescript boilerplate? When I convert those files into .ts files eslint` parser show some errors.

Definition for rule '@typescript-eslint/no-angle-bracket-type-assertion' was not found.

Definition for rule '@typescript-eslint/no-triple-slash-reference' was not found.

app/routes.ts :

import NextRoutes from 'next-routes';

const routes = new NextRoutes();

routes.add('/', '/home/index');

export default routes;

app/server.ts :

import express from 'express';
import path from 'path';
import next from 'next';

// Get an instance of `routes from `routes.js` file
import routes from './routes';

const PORT = process.env.PORT || 8000;

const app = next({
    dev: process.env.NODE_ENV !== 'production',
});

// Request handler instance created with the help of `routes.js` instance
const handler = routes.getRequestHandler(app);

// Prepare the server
app.prepare().then(() => {
    // Take the server instance
    const server = express();

    // If user has define the different static path in the environment variable
    // for the `Next.js` assets then please set that.
    app.setAssetPrefix(process.env.STATIC_PATH);

    // Set assets path for our server
    server.use(express.static(path.join(__dirname, '../public')));

    // Get anything whatever URL we are having.
    server.get('*', (req, res) => {
        return handler(req, res);
    });

    // Listen for the sever
    server.listen(PORT, (err) => {
        if (err) throw err;
        console.log(`> Ready on http://localhost:${PORT}`);
    });
});

how we can load custom font?

How this get work with scss?

@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; src: url('assets/fonts/roboto-v20-latin-300.eot'); /* IE9 Compat Modes */ src: local('Roboto Light'), local('Roboto-Light'), url('assets/fonts/roboto-v20-latin-300.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('assets/fonts/roboto-v20-latin-300.woff2') format('woff2'), /* Super Modern Browsers */ url('assets/fonts/roboto-v20-latin-300.woff') format('woff'), /* Modern Browsers */ url('assets/fonts/roboto-v20-latin-300.ttf') format('truetype'), /* Safari, Android, iOS */ url('assets/fonts/roboto-v20-latin-300.svg#Roboto') format('svg'); /* Legacy iOS */ }

Any plans on integrating feathersjs?

I think this boilerplate will be more complete if we could also add feathersjs which is a lightweight API framework. Since it already uses Express, I think it will be a nice add on and make this boilerplate more fullstack.

No html tags being shown on page source after building the boilerplate.

After building the nextjs boilerplate,
I am not getting the the <div, <a> and other elements on page source. Just getting
<body><div id="__next"></div>

This won't be useful for SEO right. The web crawling bots won’t be able to extract and index the required data. How can I fix this? Thanks.

How to persist Redux State/Store?

Hi,
I just realized that my Redux State is being reset everytime, when I refresh the page or do a internal serverside redirect.
I saw in 593d978 that redux-persist was removed.

How can I persist the Redux State/Store in this Boilerplate? Do I need to reimplement redux-persist or is there a newer/better way of achieving this functionality?

Global SCSS variables

Hi, I have an error with global variables.
I have the following structure:
Screen Shot 2020-03-24 at 18 51 45

And I have scss in root/public/scss/main.scss which I import in _app.tsx

Problem is that scss vars are not accessible in components style.
And also static map is deprecated should be renamed to public.
Can you help me please ?

Need replace getInitialProps with getServerSideProps

getInitialProps is deprecated now.

So, with code in this boilerplate we always get void object at props when try use getServerSideProps.

I don’t have enough knowledge to suggest a solution = ( but i think need rewrite _app/index.tsx.

Compile error

Hello,

I get a compile error when I build the upgrade-to-next-9 branch.

npm run build

> [email protected] build F:\next-boilerplate
> cross-env NODE_ENV=production next build

Creating an optimized production build ...

> Using external babel configuration
> Location: "F:\next-boilerplate\.babelrc"
Failed to compile.

./src/Components/Heading/style.scss 2:0
Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
> .title {
|     display: flex;
|     flex-direction: column;

> Build error occurred
Error: > Build failed because of webpack errors
    at build (F:\next-boilerplate\node_modules\next\dist\build\index.js:7:847)
    at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `cross-env NODE_ENV=production next build`
npm ERR! Exit status 1

What am I missing?

HMR for styled child components not working

Hi!
Perfect starter, i like it very much!

I found a bug with HMR for child styled components.
For example if you modify shared Button component's styles in Basic/Button/index.tsx it is not reloaded, after page reload styles are not applied too. So there is only one solution - rebuild project and start dev again.

Unable to successfully deploy

I am trying to deploy it but getting following error:

{
"errorType": "Error",
"errorMessage": "ENOENT: no such file or directory, scandir '/var/task/public/static/locales/en'",
"code": "ENOENT",
"errno": -2,
"syscall": "scandir",
"path": "/var/task/public/static/locales/en",
"stack": [
"Error: ENOENT: no such file or directory, scandir '/var/task/public/static/locales/en'",
" at Object.readdirSync (fs.js:955:3)",
" at getAllNamespaces (/var/task/pages/_error.js:24275:19)",
" at createConfig (/var/task/pages/_error.js:24280:27)",
" at new NextI18Next (/var/task/pages/_error.js:30962:48)",
" at Object.kluC (/var/task/pages/_error.js:24933:29)",
" at webpack_require (/var/task/pages/_error.js:23:31)",
" at Module.iJV/ (/var/task/pages/_error.js:23264:70)",
" at webpack_require (/var/task/pages/_error.js:23:31)",
" at Module.5L4k (/var/task/pages/_error.js:4153:19)",
" at webpack_require (/var/task/pages/_error.js:23:31)"
]
}

I tried the solution provided in this link i18next/next-i18next#577 (comment) But still getting same error.

How do I get the call to api?

Hi, reviewing your boilerplate and i not seen call api example. How do I get the call to api? Is there a special method you use? Axios or should I use derivatives?

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.