Why is gridsome-plugin-typescript causing an UnhandledPromiseRejection warning?

177 views Asked by At

I'm having trouble getting typescript working in my gridsome app. I ran gridsome develop before installing typescript to be sure I got everything installed properly so far and the landing page loads at localhost:8080 as expected. However when I install the gridsome-plugin-typescript package as outlined in Gridsome's documentation the site won't load anymore. I get this following error.

(node:12192) UnhandledPromiseRejectionWarning: Error: Rule can only have one resource source (provided resource and test + include + exclude) in {...}

The {...} is this json object

{
  "exclude": [
    null
  ],
  "use": [
    {
      "loader": "cache-loader",
      "options": {
        "cacheDirectory": "C:\\Development\\ovaad-craft-workspace-vue\\ovaad-craft-site\\node_modules\\.cache\\gridsome",
        "cacheIdentifier": "3a9e07ea"
      },
      "ident": "clonedRuleSet-1[0].rules[0].use[0]"
    },
    {
      "loader": "babel-loader",
      "options": {
        "presets": [
          [
            "C:\\Development\\ovaad-craft-workspace-vue\\ovaad-craft-site\\node_modules\\@vue\\babel-preset-app\\index.js",
            {
              "entryFiles": [
                "C:\\Development\\ovaad-craft-workspace-vue\\ovaad-craft-site\\node_modules\\gridsome\\app\\entry.server.js",
                "C:\\Development\\ovaad-craft-workspace-vue\\ovaad-craft-site\\node_modules\\gridsome\\app\\entry.client.js"
              ]
            }
          ]
        ]
      },
      "ident": "clonedRuleSet-1[0].rules[0].use[1]"
    }
  ]
}

I have no clue what file this came from but I couldn't help but to notice all the paths have \\ between each location which I've personally never seen done. Could that be what's preventing it from loading? Aside from that it's causing webpack to break in several of its' core files. Does anybody have any clue as to what could be causing this? Everything works until I add typescript into the equation.

UPDATE

At the bottom of the documentation for installing gridsome-plugin-typescript there's a link that says Tyescript Starter For Gridsome that takes you to a github repository. It says to run gridsome create gridsome-ts https://github.com/cleitonper/gridsome-starter-typescript.git in the terminal and that should install everything. I received the following error

Error: Failed to install dependencies with npm. Please enter ovaad-craft-website directory and install dependencies with Exit code 1 at ChildProcess. (C:\Users\Optiq.DESKTOP-OM5QKKQ.000\AppData\Roaming\npm\node_modules@gridsome\cli\lib\commands\create.js:106:17) at ChildProcess.emit (events.js:315:20) at ChildProcess.cp.emit (C:\Users\Optiq.DESKTOP-OM5QKKQ.000\AppData\Roaming\npm\node_modules@gridsome\cli\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (internal/child_process.js:1048:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

I went into my project folder and ran npm install and that just gave back another chain of errors.

If it helps any I'm running a Windows 10 PC.

0

There are 0 answers