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

Unexpected error. #2

Open
fieldju opened this issue May 17, 2019 · 1 comment
Open

Unexpected error. #2

fieldju opened this issue May 17, 2019 · 1 comment

Comments

@fieldju
Copy link

fieldju commented May 17, 2019

I am seeing the following stack trace, when trying to apply this plugin to a second, project.

[!] (rename-rollup plugin) TypeError: baseVisitor[type] is not a function
TypeError: baseVisitor[type] is not a function
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.base.NewExpression.base.CallExpression (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:341:3)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.base.MemberExpression (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:347:3)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.base.NewExpression.base.CallExpression (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:341:3)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.base.MemberExpression (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:347:3)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.base.NewExpression.base.CallExpression (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:341:3)
    at c (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:23:22)
    at Object.skipThrough (/Users/jfiel2/dev/spinnaker/deck/app/scripts/modules/core/node_modules/acorn-walk/src/index.js:182:37)

error Command failed with exit code 1.

interestingly enough this plugin works just fine in the first project I applied it to.

Here is the relevant section my my rollup config

  input: [webpackConfig.entry.lib],
  output: { name: 'core', dir: 'lib/', format: 'es', sourcemap: true },
  treeshake: true,
  preserveModules: true,
  plugins: [
    renameExtensions({
      include: ['**/*.ts', '**/*.tsx'],
      mappings: {
        '.ts': '.js',
        '.tsx': '.js',
      }
    }),

I doubt this is enough information to be useful, but I will create the issue anyways and attach a remote debugger in the morning.

Cheers,

Justin

@TomCaserta
Copy link
Contributor

Hey I'll take a look later today. I think the issue may be that the library I'm using to simplify walking over the AST (acorn ewalk) doesn't support the target your typescript is outputting.

I'll need to replace it to get it to work. ( You can try changing the target in tsconfig if that's doable for your codebase but I guess that would defeat the purpose of you're outputting modules.)

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

2 participants