Y
Y
yativ_sobb2018-05-22 13:37:13
JavaScript
yativ_sobb, 2018-05-22 13:37:13

Error in laravel "TS2307: Cannot find module './components/App.vue'.?

When compiling, I get the error "TS2307: Cannot find module './components/App.vue'."?

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');
require('laravel-elixir-webpack');

elixir((mix) => {
    mix
    .sass('app.scss')
    .webpack("resources/assets/js/app.ts",{
        module: {
            loaders: [
                {
                    test: /\.ts?$/,
                    loader: 'ts-loader',
                    options: {
              			appendTsSuffixTo: [/\.vue$/], 
            		}
                },

            ],
        }
    });
});

<template>
    <div></div>
</template>
<script lang="ts">
import Vue from "vue";
import Component from 'vue-class-component'

@Component()
export default class App extends Vue {
  created(){
    console.log("Test")
  }
}
</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LightAir, 2018-05-23
@LightAir

If you really need elixir, then try adding this
https://www.npmjs.com/package/elixir-typescript
In 5.4 laravel-elixir was renamed to laravel-mix.
Here is the instruction for mix
https://sebastiandedeyne.com/typescript-with-larav...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question