Closed ktiedt closed 6 years ago
Quokka is correctly reporting the runtime error. There is no named UrlSearchParams
export, the module has a default export, so the import should be not:
import { UrlSearchParams } from './UrlSearchParams';
but:
import UrlSearchParams from './UrlSearchParams';
Well consider me embarrassed, I assumed since it was a named class it was also a named export, it is directly copied sample code from their codebase so that didn't help since I trusted they would have got their samples right :/
As for it working, the error certainly goes away, however, I still cannot get live output from quokka... even if I through in a console.log(result).
For reference. (and no, there is nothing below that)
Hmm, I have no issues running the exact same sample, in the same editor and the same node version:
Have you opened the project in Atom? Looks like the version of TypeScript used in your case is the one that ships with Quokka (as opposed to the project's TypeScript version, like on my screenshot). It may mean that you haven't opened the project.
Have you opened the project in Atom? Looks like the version of TypeScript used in your case is the one that ships with Quokka (as opposed to the project's TypeScript version, like on my screenshot). It may mean that you haven't opened the project.
Good call, this made for a great end to a very long day of driving :) -- I had opened the project at core/src
using atom .
-- closing it and repeating from core/
does in fact make things work. Will have to keep that in mind since I seldom open things from the root when I can just CLI the file (and access the project).
I'm guessing there isnt a way to avoid that breaking things?
And thank you by the way, I know I've opened several bugs recently, really looking forward to learning more about y'alls amazing tool, just so far, finding all the ways to break I suppose :/
I'm guessing there isnt a way to avoid that breaking things?
If it was a file that doesn't import anything, then it would work fine - Quokka can run it. However, when any other files are imported, ts-node
comes into play and when it can't find a valid tsconfig.json (because the working directory is core/src
and not core
), then ts-node
fails.
Gotcha, will keep that in mind, definitely enjoying the flexibility that Quokka has provided in live debugging :) Thanks again!
Issue description or question
Writing a really simple test using Dojo2 (typescript based) and quokka I run into
UrlSearchParams_1.UrlSearchParams is not a constructor
from the below code. (test file is a sibling of the UrlSearchParams.ts file in this case) and just to prove there is a constructor... you can see the declaration here: https://github.com/dojo/core/blob/master/src/UrlSearchParams.ts#L44Sample code
Quokka.js Console Output
Code editor version
Atom v1.27.1
OS name and version
OSX High Sierra (latest public version)