glimmerjs / glimmer-vm

MIT License
1.13k stars 190 forks source link

Unhelpful message if mentioned helpers or modifiers does not imported into scope #1350

Closed lifeart closed 2 years ago

lifeart commented 2 years ago

image

lifeart commented 2 years ago

found issue, messages are correct for DEBUG environment flag, but it's not enabled in final bundles, that's why it's too hard to debug it.

likely babel-plugin-debug-macros should handle it for dev environment, but it's not

lifeart commented 2 years ago

looks like configuration from https://github.com/glimmerjs/glimmer-vm/blob/master/packages/build-utils/%40glimmer/vm-babel-plugins/index.js#L22 and https://github.com/glimmerjs/glimmer.js/blob/master/packages/%40glimmer/babel-preset/index.js#L32 overshade somehow in vite

lifeart commented 2 years ago

interesting, this chunk is generated, but without data, processed with babel plugin

import {
  __esm
} from "./chunk-XNAE4CLY.js";

// node_modules/@glimmer/env/dist/modules/es2017/index.js
var DEBUG;
var init_es2017 = __esm({
  "node_modules/@glimmer/env/dist/modules/es2017/index.js"() {
    DEBUG = false;
  }
});

export {
  DEBUG,
  init_es2017
};
//# sourceMappingURL=chunk-HBQKIAIV.js.map

looks like this plugin is "touching" files before babel processing https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/importAnalysisBuild.ts