rsnext/examples/blog-starter-typescript/package.json

30 lines
634 B
JSON
Raw Normal View History

{
"private": true,
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"typecheck": "tsc"
},
"dependencies": {
Fix build in blog-starter-typescript example (#24695) This example currently fails to build with the error: ``` -> % yarn build yarn run v1.22.10 $ next build warn - React 17.0.1 or newer will be required to leverage all of the upcoming features in Next.js 11. Read more: https://nextjs.org/docs/messages/react-version info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5 Failed to compile. ./components/alert.tsx:2:16 Type error: Could not find a declaration file for module 'classnames'. '/Users/mike/workspace/blog/node_modules/classnames/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/classnames` if it exists or add a new declaration (.d.ts) file containing `declare module 'classnames';` 1 | import Container from './container' > 2 | import cn from 'classnames' | ^ 3 | import { EXAMPLE_PATH } from '../lib/constants' 4 | 5 | type Props = { error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` As of [`v2.3.1`](https://github.com/JedWatson/classnames/blob/master/HISTORY.md#v230--2021-04-01), the `classnames` package started providing its own types, so the `@types/classnames` package [became a stub](https://unpkg.com/browse/@types/classnames@2.3.1/). We get the error because the `classnames` version is pinned to the old, type-less version, while `@types/classnames` picked up the new stubbed version. Removing `@types/classnames` and updating `classnames` to the latest version fixes the build error. ## Documentation / Examples - [x] Make sure the linting passes
2021-05-10 21:59:49 +02:00
"classnames": "2.3.1",
"date-fns": "2.21.3",
"gray-matter": "4.0.3",
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remark": "14.0.2",
"remark-html": "15.0.1",
"typescript": "^4.2.4"
},
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/node": "^15.6.0",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"autoprefixer": "10.4.0",
"postcss": "8.4.5",
"tailwindcss": "3.0.5"
}
}