I am trying to create a new scheme that extends off of OAuth2. Like so:
import OAuth2 from '@nuxtjs/auth/lib/schemes/oauth2'
export default class newScheme extends OAuth2 {...
I get this error ERROR in ./node_modules/@nuxtjs/auth/lib/schemes/oauth2.js
Module not found: Error: Can't resolve '../utilities' in '/Users/afeezawoyemi/workspace/P/logistics-config-ui/node_modules/@nuxtjs/auth/lib/schemes'
It appears the utilities module is indeed not present in the specified relative path, what is the right way to extend OAuth2 scheme?
import OAuth2 from '@nuxtjs/auth/lib/schemes/oauth2'
export default class newScheme extends OAuth2 {...
nuxt.config.jsERROR in ./node_modules/@nuxtjs/auth/lib/schemes/oauth2.js
Module not found: Error: Can't resolve '../utilities' in '/Users/afeezawoyemi/workspace/P/logistics-config-ui/node_modules/@nuxtjs/auth/lib/schemes'
New scheme should work without errors
PS:
Thank y'all for your contributions to the Nuxt community.
May be related to #176
Might be fixed by https://github.com/nuxt-community/auth-module/pull/774? @timrchavez @JoaoPedroAS51
Digging a little deeper, I see the issue originated from this line on master (which I'm currently using, not the dev branch).
Line one:
import { encodeQuery, parseQuery, addTokenPrefix } from '../utilities'
whereas there's no utilities directory/file in the specified relative path (utilities is defined in lib/core/utilities.js, which doesn't match the specified path).
Seems to work internally and only freaks out when referencing module are exported externally (while attempting to extend oauth2 module in my own case)
Bumped into this issue as well. Probably path to methods should be updated to fix the issue
I switched to the dev branch, that solves my issue.
I don't know if it's worth raising a pr to fix this on master? Otherwise, I'm willing to close this since the dev branch is more updated and should fix issues like this mostly.
@damafeez yes, i see they've moved utils to the proper location and it should work there. do you know any ETA when dev would be merged into master?
p.s. i think we can close PR with mark that it's fixed in dev branch for future reference
@gorenburg re ETA, I've been wondering also. master's been behind for so long, I wonder if there's any plan to merge them soon. Anyway, I'll just stick to the dev branch for now.
Most helpful comment
Digging a little deeper, I see the issue originated from this line on master (which I'm currently using, not the dev branch).
Line one:
import { encodeQuery, parseQuery, addTokenPrefix } from '../utilities'whereas there's no
utilitiesdirectory/file in the specified relative path (utilitiesis defined in lib/core/utilities.js, which doesn't match the specified path).Seems to work internally and only freaks out when referencing module are exported externally (while attempting to extend oauth2 module in my own case)