deligenius / view-engine

🚀A Template View Engine for Deno frameworks
MIT License
54 stars 15 forks source link

error with deno 1.4.0 #18

Closed swifityG closed 3 years ago

swifityG commented 3 years ago

hey with deno 1.4.0 there some problem can you fix it

error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export {Options as EjsOptions} from './ejs.d.ts'
        ~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/engines/ejs/mod.ts:4:9

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Engine, ViewConfig } from "../types/index.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/engines/ejs.ts:14:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Engine,ViewConfig } from "../types/index.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/engines/handlebars.ts:2:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Context } from "https://deno.land/x/oak@v6.2.0/mod.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/adapters/oak.ts:1:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Adapter, ViewConfig, Engine } from "../types/index.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/adapters/oak.ts:2:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Adapter } from "./types/index.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/adapterFactory.ts:1:1

TS1371 [ERROR]: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
import { Adapter, Engine, ViewConfig } from "./types/index.ts";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/lib/viewEngine.ts:1:1

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { Engine, Adapter, ViewConfig } from "./lib/types/index.ts"
         ~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/mod.ts:1:10

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { Engine, Adapter, ViewConfig } from "./lib/types/index.ts"
                 ~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/mod.ts:1:18

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { Engine, Adapter, ViewConfig } from "./lib/types/index.ts"
                          ~~~~~~~~~~
    at https://raw.githubusercontent.com/deligenius/view-engine/master/mod.ts:1:27

Found 10 errors.
gjuoun commented 3 years ago

How do you use view-engine? Maybe some code piece would be helpful

swifityG commented 3 years ago

I already figured it out, its beacuse deno 1.4.0+ use isolatedModules in the typescript compilerOptions which throws this error in alot of stuffs forgot to say its only when you use --unstable

tinkajts commented 3 years ago

@swifityG , same problems... and i need the --unstable flag to include some Deno-funcions that is in "unstable" version. How did you manage to get this fixed?

swifityG commented 3 years ago

@tinkajts create tsconifg.json file like this

 {
  "compilerOptions": {
    "importsNotUsedAsValues":"remove",
    "isolatedModules":false
  }
}

and launch deno with the flag -c pointing to the tsconfig.json

gjuoun commented 3 years ago

please use the newest version view-engine v1.4.5 tested in deno 1.5.3