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

Using debugger in some context stack overflows Imba compiler #663

Open
taw opened this issue Mar 30, 2022 · 1 comment
Open

Using debugger in some context stack overflows Imba compiler #663

taw opened this issue Mar 30, 2022 · 1 comment

Comments

@taw
Copy link
Contributor

taw commented Mar 30, 2022

Imba Version: 2.0.0-alpha.199

Details

Here are some minimal examples:

def foo
	debugger
def foo
	imba.setInterval(&,1000) do
		debugger

It happens as standalone function, or a method of a component. In every case where debugger statement is at the end of a method definition or a block. It generally doesn't happen if something directly follows the debugger statement.

It generates this error:

ERROR COMPILING IMBA RangeError: Maximum call stack size exceeded
@haikyuu
Copy link
Collaborator

haikyuu commented Mar 31, 2022

Faced it as well.

class A
	def startMonitoring
		return unless env.PG_PUBLICATION_NAME
		const sql = postgres uri,
			publications: env.PG_PUBLICATION_NAME
			fetch_types: no

		try
			const { unsubscribe } = await sql.subscribe '*' do(row, { command, relation, key, old })
				console.log 'event 1', row
				debugger

And it's extremely hard to detect. As the bundler just ignores the file if it's imported. So you see errors like this in the console

 > app/server/session.imba:9:8: warning: Import "sql" will always be undefined because the file "app/server/db.imba" has no exports
    9 │ import {sql} from './db'/*$path$*/;

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

No branches or pull requests

3 participants