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

TypeError thrown when heredoc defined incorrectly with <<< instead of << #117

Closed
rcjsuen opened this issue Nov 3, 2024 · 0 comments
Closed
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Nov 3, 2024

import { DockerfileParser, Run } from 'dockerfile-ast';
const content = "RUN <<<test\ntest\n";
const dockerfile = DockerfileParser.parse(content);
const run = dockerfile.getInstructions()[0] as Run;
run.getHeredocs();
./node_modules/dockerfile-ast/lib/instruction.js:842
            const startRange = arg.getRange();
                                   ^

TypeError: Cannot read properties of undefined (reading 'getRange')
    at Run.getHeredocs (./node_modules/dockerfile-ast/lib/instruction.js:842:36)
    at Run.getHeredocs (./node_modules/dockerfile-ast/lib/instructions/run.js:19:22)
    at Object.<anonymous> (./out/src/main.js:7:5)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.16.0
@rcjsuen rcjsuen added the bug label Nov 3, 2024
@rcjsuen rcjsuen self-assigned this Nov 3, 2024
@rcjsuen rcjsuen closed this as completed in f0bdecf Nov 9, 2024
rcjsuen added a commit that referenced this issue Nov 10, 2024
Signed-off-by: Remy Suen <remy.suen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant