Comments (11)
@omotayoR1 I have no access to Windows right now and have no way to check for a fix.
My best guess is that somehow path in C:\Users\directory\Documents\d\node_modules@callstack\repack-dev-server\dist\plugins\faviconPlugin.js
evaluates incorrectly, you can try adjust it to see if it resolves this.
from repack.
@omotayoR1 I have no access to Windows right now and have no way to check for a fix.
My best guess is that somehow path in
C:\Users\directory\Documents\d\node_modules@callstack\repack-dev-server\dist\plugins\faviconPlugin.js
evaluates incorrectly, you can try adjust it to see if it resolves this.
I checked the path mentioned and on line 24, it seems something is wrong there const fp = require('fastify-plugin')
What's the resolution please
Thanks for helping
from repack.
@omotayoR1 could you provide a snippet? I see the file has only like 15 LOC
from repack.
@omotayoR1 could you provide a snippet? I see the file has only like 15 LOC
/*
- Copyright 2018-2023 the original author or authors.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*/
'use strict'
/**
- Plugin:
- this module exports the plugin as a function.
- @module plugin
*/
const fp = require('fastify-plugin')
const pn = require('node:path')
const fs = require('node:fs')
const iconNameDefault = 'favicon.ico'
/**
- Plugin implementation.
- @param {!object} fastify Fastify instance
- @param {!object} options plugin configuration options
-
-
<li>path (string, default `__dirname`) for the folder containing the icon,</li>
-
<li>name (string, default 'favicon.ico') for favicon file name,</li>
-
<li>maxAge (number, default 86400) for cache duration in seconds for the image,</li>
-
- @param {!function} done callback, to call as last step
- @namespace
*/
function fastifyFavicon (fastify, options, done) {
const {
path = __dirname,
name = iconNameDefault,
maxAge = 86400
} = options
ensureIsString(path, 'iconPath')
ensureIsString(name, 'iconName')
ensureIsInteger(maxAge, 'maxAge')
const icon = pn.join(path, name)
fs.readFile(icon, (err, faviconFile) => {
if (err) {
if (err.code === 'ENOENT') {
done(new Error(fastify-favicon: ${icon} not found
))
return
}
done(new Error(`fastify-favicon: Could not load ${icon}`))
return
}
fastify.get(`/${name}`, faviconRequestHandler(faviconFile))
done()
})
/**
- Factory for the request handler for the favicon.
- @param {!object} file the icon file to send in the response
- @return {function} the handler function, preconfigured with plugin settings and the file to send
- @inner
*/
function faviconRequestHandler (file) {
const cacheHeader =max-age=${maxAge}
return function handler (_fastifyRequest, fastifyReply) {
fastifyReply
.header('cache-control', cacheHeader)
.type('image/x-icon')
.send(file)
}
}
}
// utility functions
function ensureIsString (arg, name) {
if (arg !== null && typeof arg !== 'string') {
throw new TypeError(The argument '${name}' must be a string, instead got a '${typeof arg}'
)
}
}
function ensureIsInteger (arg, name) {
if (arg !== null && typeof arg !== 'string' && Number.isFinite(arg) === false && Number.isInteger(arg) === false) {
throw new TypeError(The argument '${name}' must be an integer
)
}
}
module.exports = fp(fastifyFavicon, {
fastify: '4.x',
name: 'fastify-favicon'
})
from repack.
@omotayoR1 FYI, I should be able to investigate this on Windows by the end of the week
from repack.
@omotayoR1 FYI, I should be able to investigate this on Windows by the end of the week
Okay
Thanks for helping
from repack.
@jbroma have you been able to investigate this ?
@omotayoR1 FYI, I should be able to investigate this on Windows by the end of the week
from repack.
@paaber yes, the investigation is ongoing and we're working on a fix together with @szymonrybczak
from repack.
@omotayoR1 @paaber we've just released @callstack/repack
4.0.0-rc.1, your issues should be resolved now :)
Btw, you can now install Re.Pack in new projects with custom version like this:
npx @callstack/repack-init@rc --custom-version 4.0.0-rc.1
from repack.
@omotayoR1 @paaber we've just released
@callstack/repack
4.0.0-rc.1, your issues should be resolved now :)Btw, you can now install Re.Pack in new projects with custom version like this:
npx @callstack/repack-init@rc --custom-version 4.0.0-rc.1
Thanks for helping. The server starts now and builds successfully but it stops bundling at some point and it throws this error
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({})
at Compiler.emit (node:events:508:17)
at Worker. (C:\Users\directory\Documents\anotherHastro\node_modules@callstack\repack\dist\webpack\Compiler.js:97:14)
at Worker.emit (node:events:519:28)
at MessagePort. (node:internal/worker:263:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: 'ERR_UNHANDLED_ERROR',
context: {}
}
Node.js v21.4.0
Please help me look into it
Thanks
from repack.
@omotayoR1 please open a new issue
from repack.
Related Issues (20)
- ERROR while setting up code signing HOT 2
- Issue with node v22.0.0 HOT 4
- Error: repack react native module was not found. Did you forget to update native dependencies? HOT 7
- TypeError: webpackContext.u is not a function (it is undefined)
- Property SentryError doesnt exist HOT 3
- ChunkLoad Error HOT 4
- bundling mini-apps cause crashes HOT 18
- How to config webpack to reuse existing dependencies from the main bundle HOT 4
- How to debug blank screen issue with no error output? HOT 24
- Question: getting the error: "File assets/images/<imageName>@3x.png for ios not found in compilation assets" HOT 4
- ChunkManagerPackage: No value passed for parameter 'p6' HOT 11
- More control over file path and URL for remote assets HOT 11
- Module Federation host app not working [ScriptManager] failed to load script : [NetworkFailure] HOT 1
- Error: Unhandled error. ([ScriptManager] Failed to load script:) HOT 3
- Update docs related to Expo on Usage docs page HOT 1
- Error: Unhandled error. ([ScriptManager] Failed to load script:) HOT 1
- [webpack-cli] RangeError: Maximum call stack size exceeded HOT 1
- Error : TypeError: Cannot read properties of undefined (reading 'forEach') HOT 6
- Error: no such file or directory, open '/Users/x/dev/client/packages/app/node_modules/react-native/Libraries/LogBox/Data/LogBoxData.js'"
- Error: Property 'SHA1' doesn't exist when using otpauth library HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repack.