Skip to content

Importing via import/export "pass-through" causes randomly undefined variables (TypeScript) #2243

@ffxsam

Description

@ffxsam

Version

3.0.0

Reproduction link

https://github.com/ffxsam/repro-undefined-import

Node and OS info

yarn 1.9.4, Ubuntu 18.04

Steps to reproduce

  1. Clone and run yarn
  2. yarn serve
  3. Open Chrome console, note that routes is undefined

What is expected?

routes should be an array of routes

What is actually happening?

routes is undefined


Of note is this line in the code:
https://github.com/ffxsam/repro-undefined-import/blob/master/src/components/LoginForm.vue#L100

Edit that and replace routeNames.DASHBOARD with any arbitrary string, and save. Now you'll see that routes in the console is an array. Also updating the import to the following will fix it:

import { routeNames } from '../router/route-names';

This is very strange and took me hours to track down. It may or may not be a vue-cli issue, but I figured this was a good starting point. Sorry I don't have a more descriptive issue report, but it's so random, I'm not even sure how to describe it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions