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

Error: could not resolve position from sourcemap for x #37

Open
tomardern opened this issue Mar 23, 2022 · 0 comments
Open

Error: could not resolve position from sourcemap for x #37

tomardern opened this issue Mar 23, 2022 · 0 comments

Comments

@tomardern
Copy link

Hi,

I'm trying to use this audit in a fairly large vue 2 project. I'm currently getting the following error:

Error: could not resolve position from sourcemap for {file}

It looks to be failing at this point: https://github.com/andoshin11/vue-type-audit/blob/master/src/sourcemap/index.ts#L32

const entry = sourcemapEntry.get(fileName)!

/* entry:
{
  map: {
    version: '3',
    file: '{project}/ComponentName.vue.ts',
    sections: [ [Object], [Object] ]
  }
}
*/ 

const map = entry.map!
const consumer = new SourceMapConsumer(map)
const result = consumer.originalPositionFor(location)
  
/* result:
{ source: null, line: null, column: null, name: null }
*/

The SourceMapConsumer has a different data structure to what is being provided, as there is no sections property.

export interface StartOfSourceMap {
    file?: string;
    sourceRoot?: string;
}

export interface RawSourceMap extends StartOfSourceMap {
    version: string;
    sources: string[];
    names: string[];
    sourcesContent?: string[];
    mappings: string;
}

Hope this helps.

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

No branches or pull requests

1 participant