Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular cli compile errors #119

Open
karl04 opened this issue Jul 24, 2019 · 7 comments
Open

Angular cli compile errors #119

karl04 opened this issue Jul 24, 2019 · 7 comments
Labels

Comments

@karl04
Copy link

karl04 commented Jul 24, 2019

I have integrated the plugin into my project but when I go to compile using the angular cli, I get the following error

ERROR in node_modules/filterizr/dist/FilterContainer.d.ts(1,10): error TS2305: Module '"/Users/work/project/project1/node_modules/filterizr/dist/FilterizrOptions/defaultOptions"' has no exported member 'RawOptionsCallbacks'

node_modules/filterizr/dist/FilterItems.d.ts(1,10): error TS2305: Module '"/Users/work/project/project1/node_modules/filterizr/dist/ActiveFilter"' has no exported member 'Filter'.

Is this module compatible with angular cli?

@giotiskl
Copy link
Owner

giotiskl commented Jul 25, 2019

@karl04 which Filterizr version are you using?

Can you share also a code snippet please of where the error is happening?

@karl04
Copy link
Author

karl04 commented Jul 25, 2019

@giotiskl I'm using version filterizr": "^2.2.3"

when I run the ng build command, it throws the above errors

@giotiskl
Copy link
Owner

@karl04 can you share the code snippet where you import/use Filterizr or are the errors simply thrown by adding filterizr to your node modules and runing the ng build command?

It looks like there's some problem with the type declarations shipped with Filterizr, adding to your tsconfig.json the following will temporarily disable these issues (most likely) but that's not a proper fix ofc.

{
    "compilerOptions": {
        "skipLibCheck": true,
        ...
    },
    ...
}

I'll have to look more into this

@karl04
Copy link
Author

karl04 commented Jul 25, 2019

the errors simply thrown by adding filterizr to node modules and running the ng build command.

yes it compiles with the flag enabled, but is there a way to just skip checking for this module?

@giotiskl
Copy link
Owner

@karl04 could you please also share the contents of your tsconfig.json?

As far as I know the skipLibCheck option is applied to all installed (TypeScript) libraries, but is not necessarily a bad practice (e.g. FB's create-react-app has it enabled by default for newly created TypeScript React apps). In some cases it can even speed up the compilation of your own app.

The thing is that some times libraries have a less (or more) strict tsconfig than your own which can cause incompatibilities.

Although based on the error you get it looks like some types are not exported properly. I couldn't reproduce it yet unfortunately.

@giotiskl giotiskl added the bug label Jul 25, 2019
@karl04
Copy link
Author

karl04 commented Jul 26, 2019

{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
//"skipLibCheck": true,
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
},

"exclude": ["./node_modules"],
"angularCompilerOptions": {
"preserveWhitespaces": false
}
}

@mikr96
Copy link

mikr96 commented Aug 11, 2019

I have integrated the plugin into my project but when I go to compile using the angular cli, I get the following error
ERROR in node_modules/filterizr/dist/FilterContainer.d.ts(1,10): error TS2305: Module '"/Users/work/project/project1/node_modules/filterizr/dist/FilterizrOptions/defaultOptions"' has no exported member 'RawOptionsCallbacks'
node_modules/filterizr/dist/FilterItems.d.ts(1,10): error TS2305: Module '"/Users/work/project/project1/node_modules/filterizr/dist/ActiveFilter"' has no exported member 'Filter'.
Is this module compatible with angular cli?

I also had the same error with ionic 4. Any solution ?

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

No branches or pull requests

3 participants