Skip to content

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

@jrentlez

Description

@jrentlez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions