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] "Object is possibly 'undefined'" in hint-compat [0.1] #1661

Closed
molant opened this issue Jan 10, 2019 · 2 comments
Closed

[Bug] "Object is possibly 'undefined'" in hint-compat [0.1] #1661

molant opened this issue Jan 10, 2019 · 2 comments

Comments

@molant
Copy link
Member

molant commented Jan 10, 2019

When I try to build hint-compat-api I get a "Object is possibly 'undefined'" error in getProblemLocationFromNode

private getProblemLocationFromNode(node: ChildNode): ProblemLocation | undefined {
        const start = node.source.start;

        if (!start) {
            return undefined;
        }

        return {
            column: start.column - 1,
            line: start.line - 1
        };
    }

It happens in 2 separate machines. @borgitas21, @antross can you please confirm and do a PR with a fix (don't know if just adding !) is enough in this situation.

Thank you!

@molant molant added this to the 1901-1 milestone Jan 10, 2019
@antross antross self-assigned this Jan 10, 2019
@antross
Copy link
Member

antross commented Jan 10, 2019

At first glance this looks like an issue due to a change in type definitions in a patch update of postcss. It just bumped to 7.0.8 two days ago (we reference 7.0.7).

I should have a PR ready shortly.

@antross
Copy link
Member

antross commented Jan 10, 2019

For reference, here's the PR that broke us (released as part of postcss 7.0.8):
postcss/postcss#1217

It corrects the type definitions to match what postcss was already doing in previous versions (they were out-of-sync).

antross added a commit to antross/hint that referenced this issue Jan 10, 2019
Fix webhintio#1661

Found via a recent type definition update to `postcss`.
@alrra alrra closed this as completed in e844ed8 Jan 10, 2019
@molant molant changed the title [Bug] "Object is possibly 'undefined'" in hint-compat [Bug] "Object is possibly 'undefined'" in hint-compat [0.1] Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants