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: You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.Because the code uses the null merge operator (??) #280

Open
xuyanmei opened this issue Oct 13, 2022 · 10 comments

Comments

@xuyanmei
Copy link

Info

Tool Version
Plugin ^2.0.0
Vue v2.x.x
Node 14.17.0
OS win

Input

const baseUrl = vueRouter.options.base ?? ""

Output or Error

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Expected Output

Additional Context

in my nuxt project,npm run in vscode,It seems that the null value merge operator (??) is used。Previous versions using ^ 1.3.0 will not look like this

【error】
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

 const baseUrl = vueRouter.options.base ?? ""

@ ./plugins/gtm.ts 2:0-43 6:10-16

@Shinigami92
Copy link
Contributor

Which version of WebPack are you using?

I think the best option for you right now is to stay on v1.3.0 and wait until you can support modern environment code.

@xuyanmei
Copy link
Author

WebPack

Thank you for your answer ,maybe "webpack": "^4.46.0",I thought that the high version might have solved many bugs

@Shinigami92
Copy link
Contributor

Ah yeah, v2.0.0+ is not compatible anymore with WebPack v4
Maybe it is with WebPack v5, but I highly recommend to try out Vite instead

@fdsprop
Copy link

fdsprop commented Dec 12, 2022

I am having the same problem, how did you solved it?

@juliantn
Copy link

Same here using these versions...

"@gtm-support/vue-gtm": "^2.0.0"
"webpack": "^4.46.0"

@alfreema
Copy link

Also having this issue.

@juliantn ...

Changing the package.json from:

"@gtm-support/vue2-gtm": "^2.0.0",

to

"@gtm-support/vue2-gtm": "^1.3.0",

got me to a running state.

@makerovski
Copy link

The solution from @alfreema does not work for me, any ideas ?

@ljuborados
Copy link

@makerovski add "@gtm-support/*" to transpileDepenencies in vue.config.js

@makerovski
Copy link

I got a solution for this, I use the tracking in a Method like :

 methods: {
    sendTracking() {
      this.$gtm.trackEvent({
        event: "form-submit",
        Modell: this.configuration.model.name,
        Preis: this.totalPrice,
        noninteraction: false
      });
    },
  },

And in main.js:

import VueGtm from "vue-gtm";

Vue.use(VueGtm, {
  id: "GTM-XXXXXX",
  defer: false,
  enabled: true,
  debug: false,
  loadScript: true,
  trackOnNextTick: false
});

And it worked, maybe helps someone. Thank you!

@TrejoCode
Copy link

Same error,

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

8 participants