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

[BUG] Interpreter does not report a missing block definition if a blocks name matches a block type in stdlib #640

Open
TungstnBallon opened this issue Jan 24, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@TungstnBallon
Copy link
Contributor

Steps to reproduce

  1. Run the following pipeline:
pipeline DummyPipeline {
	Extractor
		-> TableTransformer
		-> Loader;

	block Extractor oftype HttpExtractor {
		url: "https://gist.githubusercontent.com/noamross/e5d3e859aa0c794be10b/raw/b999fb4425b54c63cab088c0ce2c0d6ce961a563/cars.csv";
	}

	block Loader oftype SQLiteLoader {
		table: "Cars";
		file: "./cars.sqlite";
	}
}

Instead of TableTransformer the missing block could be named after any block type exported by std-lib.

Description

  • Expected: The interpreter and language server emit an appropriate error message.
  • Actual: The interpreter crashes with this message:
/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:355
    const blockTypeName = block.type.ref?.name;
                                     ^


TypeError: Cannot read properties of undefined (reading 'ref')
    at toString (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:355:38)
    at <anonymous> (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:362:23)
    at Array.map (<anonymous>)
    at toString (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:362:8)
    at logPipelineOverview (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:384:2
2)
    at DefaultJayveeInterpreter.runPipeline (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/int
erpreter.ts:313:5)
    at <anonymous> (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/src/interpreter.ts:271:21)
    at Array.map (<anonymous>)
    at DefaultJayveeInterpreter.interpretJayveeProgram (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-
lib/src/interpreter.ts:269:65)
    at DefaultJayveeInterpreter.interpretProgram (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib/sr
c/interpreter.ts:156:47)
    at async DefaultJayveeInterpreter.interpretFile (/home/jonas/Code/uni/hiwi/jayvee/libs/interpreter-lib
/src/interpreter.ts:182:12)
    at async Command.runAction (/home/jonas/Code/uni/hiwi/jayvee/apps/interpreter/src/run-action.ts:54:20)

and the language server does not report anything

@TungstnBallon TungstnBallon added the bug Something isn't working label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant