GithubHelp home page GithubHelp logo

Comments (9)

tiansivive avatar tiansivive commented on June 12, 2024

Was literally about to open up an issue for this problem.

$> jupyter console --kernel=tslab
unknown msg_type: history_request
Jupyter console 6.4.0

TypeScript
In [1]: 1
unexpected error: TypeError: Cannot read properties of undefined (reading 'locals')
    at remainingDecls (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/converter.js:437:36)
    at Object.convert (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/converter.js:313:23)
    at Object.execute (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/executor.js:140:38)
    at JupyterHandlerImpl.handleExecuteImpl (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/jupyter.js:223:38)
    at /Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/jupyter.js:181:57
    at async JupyterHandlerImpl.handleExecute (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/jupyter.js:181:21)
    at async ZmqServer.handleExecute (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/jupyter.js:379:25)
    at async ZmqServer.handleShellMessage (/Users/tiansivive/.nvm/versions/node/v16.13.1/lib/node_modules/tslab/dist/jupyter.js:324:21)
Shutting down kernel
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<ZMQTerminalInteractiveShell.interact() done, defined at /Users/tiansivive/opt/anaconda3/lib/python3.9/site-packages/jupyter_console/ptshell.py:635> exception=KeyError('execution_count')>
Traceback (most recent call last):
  File "/Users/tiansivive/opt/anaconda3/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 648, in interact
    self.run_cell(code, store_history=True)
  File "/Users/tiansivive/opt/anaconda3/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 730, in run_cell
    self.handle_execute_reply(msg_id, timeout=0.05)
  File "/Users/tiansivive/opt/anaconda3/lib/python3.9/site-packages/jupyter_console/ptshell.py", line 768, in handle_execute_reply
    self.execution_count = int(content["execution_count"] + 1)
KeyError: 'execution_count'

from tslab.

tiansivive avatar tiansivive commented on June 12, 2024

Seems like this is only an issue in the latest release.

Uninstalling and installing v1.0.16 via

fixes the issue.

Looks like there's been some changes to src/converter.ts which are causing the issue

from tslab.

tiansivive avatar tiansivive commented on June 12, 2024

I've tracked down the issue to one of these 2 lines:

tslab/src/converter.ts

Lines 588 to 589 in 81289c8

const declLocals = declsSF.locals as ts.SymbolTable;
const locals = srcSF.locals as ts.SymbolTable;

Seems like the srcSF or decsSF are undefined, so something must be going wrong in the convert function

function convert(prevDecl: string, src: string): ConvertResult {

from tslab.

yunabe avatar yunabe commented on June 12, 2024

Thank you for the report. The TypeScript compiler's watch mechanism changed in v4.9 (tslab: v1.0.18) and I think the change in TypeScript compiler is suspicous although I cannot reproduce the issue on Linux Node.js.

@tiansivive Does this happen from which version of tslab? Do tslab v1.0.17 and v1.0.18 work in your environment?

from tslab.

vangj avatar vangj commented on June 12, 2024

This happens on v1.0.19. I'll try to uninstall and downgrade and report back. Thanks.

from tslab.

vangj avatar vangj commented on June 12, 2024

I can confirm that this issue does not happen on v1.0.16 using Node v18.16.0. Thanks for the help! Please close the ticket if appropriate.

from tslab.

tiansivive avatar tiansivive commented on June 12, 2024

@yunabe oh, I didn't realise I skipped those versions. I tried them now and v1.0.17 works but not v1.0.18.
So it does seem like it's the watch mechanism with TS 4.9

For the record, I'm running a MacBook Pro on Monterrey (12.4)

from tslab.

yunabe avatar yunabe commented on June 12, 2024

I enabled GitHub Actions to run continuous tests on Windows and MacOS.

I confirmed tests are green in all operating systems with TypeScript 4.6 (https://github.com/yunabe/tslab/actions/runs/4954329573), but tests fail in the main branch with TypeScript 5 (https://github.com/yunabe/tslab/actions/runs/4953911999).

from tslab.

yunabe avatar yunabe commented on June 12, 2024

The root cause of the problme was TypeScript changed the file normalization logic in environments with case-insensitive filesystems (e.g. Windows, MacOS). I implemeneted a workaround and released v1.0.21 with TypeScript 5.0.

Could you try v1.0.21 and let me know if it does not work?

Thanks,
yunabe

from tslab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.