Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Error while using next-typescript plugin in a simple new project. #197

Closed
nabinked opened this issue Jun 15, 2018 · 3 comments
Closed

Error while using next-typescript plugin in a simple new project. #197

nabinked opened this issue Jun 15, 2018 · 3 comments

Comments

@nabinked
Copy link

Here is the error stack

 error  in ./pages/test/index.tsx

Module build failed: Error: include option is not provided to hot-self-accept-loader. Please upgrade all next-plugins to the latest version.
    at getRoute (D:\repos\work\accounting\node_modules\next\dist\build\loaders\hot-self-accept-loader.js:28:11)
    at Object.module.exports (D:\repos\work\accounting\node_modules\next\dist\build\loaders\hot-self-accept-loader.js:16:15)

 @ multi ./pages/test/index.tsx

here is the file content in pages/test/index.tsx

import * as React from "react";

export default class Index extends React.Component<{}>{
    render() {
        return <h1>Hello world</h1>
    }
}

Package JSON

 "dependencies": {
    "@zeit/next-sass": "^0.2.0",
    "@zeit/next-typescript": "^1.0.1",
    "next": "^6.0.4-canary.7",
    "node-sass": "^4.9.0",
    "react": "^16.4.1",
    "react-dom": "^16.4.1"
  },
  "devDependencies": {
    "@types/react": "^16.3.18"
  }

.babelrc

{
    "presets": [
      "next/babel",
      "@zeit/next-typescript/babel"
    ]
  }

next.config.js

const withTypescript = require('@zeit/next-typescript')
module.exports = withTypescript()

tsconfig.js

{
    "compileOnSave": false,
    "compilerOptions": {
        "target": "esnext",
        "module": "esnext",
        "jsx": "preserve",
        "allowJs": true,
        "moduleResolution": "node",
        "allowSyntheticDefaultImports": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "removeComments": false,
        "preserveConstEnums": true,
        "sourceMap": true,
        "skipLibCheck": true,
        "noImplicitAny": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "strict": true,
        "baseUrl": ".",
        "lib": [
            "dom",
            "es2016"
        ]
    }
}
@nabinked
Copy link
Author

nabinked commented Jun 15, 2018

Sometimes it compiles fine. But then when i make any changes it throws that error,

@timneutkens
Copy link
Member

Created a pull request for next-typescript. This is related to that you're using the latest canary version, I hadn't updated next-typescript to reflect those changes.

@nabinked
Copy link
Author

Awesome Thanks (y)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants