firebase.js and authentication.js is like doc says and the error explode:
import { authentication } from './authentication.js' ^^^^^^^^^^^^^^ SyntaxError: The requested module './authentication.js' does not provide an export named 'authentication'
I've tried another approach in authentication.js:
import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
import { LocalStrategy } from '@feathersjs/authentication-local'
import { oauth, OAuthStrategy } from '@feathersjs/authentication-oauth'
const { FirebaseStrategy } = require('./firebase');
export const authentication = (app) => {
const authentication = new AuthenticationService(app)
authentication.register('jwt', new JWTStrategy())
authentication.register('local', new LocalStrategy())
authentication.register('auth0', new OAuthStrategy())
authentication.register('firebase', new FirebaseStrategy());
app.use('authentication', authentication)
app.configure(oauth())
}
Got the error as expected:
const { FirebaseStrategy } = require('./firebase');
^
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'E:\Documents\Github\feathers-adoption-api\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
Changed authentication.js:
import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication'
import { LocalStrategy } from '@feathersjs/authentication-local'
import { oauth, OAuthStrategy } from '@feathersjs/authentication-oauth'
import { FirebaseStrategy } from './firebase';
export const authentication = (app) => {
const authentication = new AuthenticationService(app)
authentication.register('jwt', new JWTStrategy())
authentication.register('local', new LocalStrategy())
authentication.register('auth0', new OAuthStrategy())
authentication.register('firebase', new FirebaseStrategy());
app.use('authentication', authentication)
app.configure(oauth())
}
Running project AS-IS, following documentation ends with a error
Doc page: https://feathersjs.com/cookbook/authentication/firebase.html
firebase.js and authentication.js is like doc says and the error explode:
import { authentication } from './authentication.js' ^^^^^^^^^^^^^^ SyntaxError: The requested module './authentication.js' does not provide an export named 'authentication'
I've tried another approach in authentication.js:
Got the error as expected:
Changed authentication.js:
New error:
If doc is not working, what should I do?