last day (17 days later) » 

1:43 AM
Hey buddy
pulling my hair out here
Im sure it's something silly >.<
 
Try import jQuery from 'jquery'; and use jQuery instead
The definition file seems to export jQuery not $. See github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/…
 
gives me one of the original errors from the OP
 
What's the content of that index file?
 
Seems to be related to the fact that it uses the export = syntax
Try this in your tsconfig


"esModuleInterop": true
 
1:53 AM
okay
 
And go back to the syntax

import * as $ from 'jquery';
That seems to be the suggestion from that report
Another post says you may need two entries:

"allowSyntheticDefaultImports": true,
"esModuleInterop": true
This is freakin complicated, so I must ask. Why are you still using jQuery in 2019? :p
 
Only reason atm was to use it was from this library I wanted to use: github.com/daneden/animate.css
Both those options in my tsconfig were already true
and the error I get from changing the import to import * as $ from 'jquery'; is...
 
Yeah, same as the original
The error is saying it can only find $ as the static object
Not the function call, and jQuery is both...
You probably know that
just in case
I wonder if something broke in the latest version
Can you try not bringing in the latest versions?
Use the versions used in the stackblitz posted as a comment
@types/jquery 3.3.29
jquery 3.3.1
 
Yeah those are what I'm using
I am using JSX and apparantly that's compiled by Babel which I've seen can be weird on imports and stuff
 
Bummer!
Sorry we couldn't figure it out, I have to get going :(
 
2:08 AM
No worries, I'm sure React or something similiar has DOM selectors :)
thanks for your time tho!
 
I would try temporarily removing the jqueryStatic.d from the index file as a debugging tool
Peace!
 

  last day (17 days later) »